mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
per space templates
This commit is contained in:
parent
574139ae21
commit
558d90d2ba
10 changed files with 73 additions and 36 deletions
|
@ -49,7 +49,13 @@ func (h *Handler) SavedList(w http.ResponseWriter, r *http.Request) {
|
|||
method := "template.saved"
|
||||
ctx := domain.GetRequestContext(r)
|
||||
|
||||
documents, err := h.Store.Document.Templates(ctx)
|
||||
folderID := request.Param(r, "folderID")
|
||||
if len(folderID) == 0 {
|
||||
response.WriteMissingDataError(w, method, "folderID")
|
||||
return
|
||||
}
|
||||
|
||||
documents, err := h.Store.Document.TemplatesBySpace(ctx, folderID)
|
||||
if err != nil {
|
||||
response.WriteServerError(w, method, err)
|
||||
h.Runtime.Log.Error(method, err)
|
||||
|
@ -67,7 +73,9 @@ func (h *Handler) SavedList(w http.ResponseWriter, r *http.Request) {
|
|||
t.Dated = d.Created
|
||||
t.Type = template.TypePrivate
|
||||
|
||||
templates = append(templates, t)
|
||||
if d.LabelID == folderID {
|
||||
templates = append(templates, t)
|
||||
}
|
||||
}
|
||||
|
||||
response.WriteJSON(w, templates)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue