Skip to content

Commit

Permalink
Remove plugin usage
Browse files Browse the repository at this point in the history
  • Loading branch information
1-Harshit committed Dec 10, 2023
1 parent 9001be4 commit 30da901
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion plugins/notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package plugins

import "github.com/spo-iitk/ras-backend/mail"

// was used in rc/admin.notice.go::postNoticeHandler is stale now
func NewNoticeNotification(mail_channel chan mail.Mail, id uint, recruitmentCycleID uint, title string, description string, createdBy string) {
if recruitmentCycleID != 6 {
return
}
var emails []string
var emails []string = []string{"[email protected]"}
message := "A new notice has been created by " + createdBy + " with title " + title + " in Placement 2023-24 Phase 1.\n\nDescription: " + description + "\n\nClick here to view the notice: https://placement.iitk.ac.in/student/rc/6/notices"
mail_channel <- mail.GenerateMails(emails, "God Notice: "+title, message)
}
3 changes: 1 addition & 2 deletions rc/admin.notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/gin-gonic/gin"
"github.com/spo-iitk/ras-backend/mail"
"github.com/spo-iitk/ras-backend/middleware"
"github.com/spo-iitk/ras-backend/plugins"
"github.com/spo-iitk/ras-backend/util"
)

Expand Down Expand Up @@ -46,7 +45,7 @@ func postNoticeHandler(mail_channel chan mail.Mail) gin.HandlerFunc {
}

// As a custom plugin by RAS God Harshit Raj, feel free to remove this after 2023. :P
plugins.NewNoticeNotification(mail_channel, notice.ID, notice.RecruitmentCycleID, notice.Title, notice.Description, notice.CreatedBy)
// plugins.NewNoticeNotification(mail_channel, notice.ID, notice.RecruitmentCycleID, notice.Title, notice.Description, notice.CreatedBy)

ctx.JSON(http.StatusOK, gin.H{"status": "notice created"})
}
Expand Down

0 comments on commit 30da901

Please sign in to comment.