MM-48614: saves priority for drafts (#21752)
* MM-48614: saves priority for drafts Adds a new column in the drafts table, "priority". This way we can save post's priority in the draft. Fixes OmitConnectionId, which when you published a ws event for a user was getting bypassed. Fixes Get for drafts returns deleted ones as well, which is needed for upsert. * Adds test case for the OmitConnectionId * Addresses review comments, removes DeleteAt * Vets * Adds missing translation * Re-instates DeleteAt column * Adds separate case to get draft including deleted * Fixes Update Draft * Empty
Этот коммит содержится в:
@@ -20,7 +20,7 @@ func (a *App) GetDraft(userID, channelID, rootID string) (*model.Draft, *model.A
|
||||
return nil, model.NewAppError("GetDraft", "app.draft.feature_disabled", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
draft, err := a.Srv().Store().Draft().Get(userID, channelID, rootID)
|
||||
draft, err := a.Srv().Store().Draft().Get(userID, channelID, rootID, false)
|
||||
if err != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
@@ -39,7 +39,7 @@ func (a *App) UpsertDraft(c *request.Context, draft *model.Draft, connectionID s
|
||||
return nil, model.NewAppError("UpsertDraft", "app.draft.feature_disabled", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
dt, dErr := a.Srv().Store().Draft().Get(draft.UserId, draft.ChannelId, draft.RootId)
|
||||
dt, dErr := a.Srv().Store().Draft().Get(draft.UserId, draft.ChannelId, draft.RootId, true)
|
||||
var notFoundErr *store.ErrNotFound
|
||||
if dErr != nil && !errors.As(dErr, ¬FoundErr) {
|
||||
return nil, model.NewAppError("UpsertDraft", "app.select_error", nil, dErr.Error(), http.StatusInternalServerError)
|
||||
@@ -189,7 +189,7 @@ func (a *App) DeleteDraft(userID, channelID, rootID, connectionID string) (*mode
|
||||
return nil, model.NewAppError("DeleteDraft", "app.draft.feature_disabled", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
draft, nErr := a.Srv().Store().Draft().Get(userID, channelID, rootID)
|
||||
draft, nErr := a.Srv().Store().Draft().Get(userID, channelID, rootID, false)
|
||||
if nErr != nil {
|
||||
return nil, model.NewAppError("DeleteDraft", "app.draft.get.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user