Changeset 0.19.0.1 (#82)
This commit is contained in:
@@ -164,6 +164,15 @@ func (h *NoteHandler) Create(c *gin.Context) {
|
||||
h.stores.NoteLinks.ResolveByTitle(c.Request.Context(), userID, note.ID, note.Title)
|
||||
}
|
||||
|
||||
// Auto-associate note with source channel's project (v0.19.0)
|
||||
if req.SourceChannelID != "" && h.stores.Projects != nil {
|
||||
projID, _ := h.stores.Projects.GetProjectIDForChannel(
|
||||
c.Request.Context(), req.SourceChannelID)
|
||||
if projID != "" {
|
||||
_ = h.stores.Projects.AddNote(c.Request.Context(), projID, note.ID)
|
||||
}
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, toNoteResponse(note))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user