mirror of
https://github.com/documize/community.git
synced 2025-07-22 14:49:42 +02:00
WIP vendored dep upgrades
This commit is contained in:
parent
5f59e95495
commit
6409ad0d63
190 changed files with 64265 additions and 109666 deletions
|
@ -78,7 +78,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err = h.Store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
||||
LabelID: document.LabelID,
|
||||
SourceID: document.RefID,
|
||||
DocumentID: document.RefID,
|
||||
SourceType: activity.SourceTypeDocument,
|
||||
ActivityType: activity.TypeRead})
|
||||
|
||||
|
@ -93,27 +93,6 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request) {
|
|||
response.WriteJSON(w, document)
|
||||
}
|
||||
|
||||
// Activity is an endpoint returning the activity logs for specified document.
|
||||
func (h *Handler) Activity(w http.ResponseWriter, r *http.Request) {
|
||||
method := "document.activity"
|
||||
ctx := domain.GetRequestContext(r)
|
||||
|
||||
id := request.Param(r, "documentID")
|
||||
if len(id) == 0 {
|
||||
response.WriteMissingDataError(w, method, "documentID")
|
||||
return
|
||||
}
|
||||
|
||||
a, err := h.Store.Activity.GetDocumentActivity(ctx, id)
|
||||
if err != nil && err != sql.ErrNoRows {
|
||||
response.WriteServerError(w, method, err)
|
||||
h.Runtime.Log.Error(method, err)
|
||||
return
|
||||
}
|
||||
|
||||
response.WriteJSON(w, a)
|
||||
}
|
||||
|
||||
// DocumentLinks is an endpoint returning the links for a document.
|
||||
func (h *Handler) DocumentLinks(w http.ResponseWriter, r *http.Request) {
|
||||
method := "document.links"
|
||||
|
@ -322,7 +301,7 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
h.Store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
||||
LabelID: doc.LabelID,
|
||||
SourceID: documentID,
|
||||
DocumentID: documentID,
|
||||
SourceType: activity.SourceTypeDocument,
|
||||
ActivityType: activity.TypeDeleted})
|
||||
|
||||
|
@ -464,7 +443,7 @@ func (h *Handler) FetchDocumentData(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err = h.Store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
||||
LabelID: document.LabelID,
|
||||
SourceID: document.RefID,
|
||||
DocumentID: document.RefID,
|
||||
SourceType: activity.SourceTypeDocument,
|
||||
ActivityType: activity.TypeRead})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue