parent
ae66331636
commit
b9d5e9fc24
21
pkg/service_internal/operations.go
Normal file
21
pkg/service_internal/operations.go
Normal file
@ -0,0 +1,21 @@
|
||||
package service_internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.itzana.me/strafesnet/maps-service/pkg/datastore"
|
||||
internal "git.itzana.me/strafesnet/maps-service/pkg/internal"
|
||||
"git.itzana.me/strafesnet/maps-service/pkg/model"
|
||||
)
|
||||
|
||||
// ActionOperationFailed implements actionOperationFailed operation.
|
||||
//
|
||||
// Fail the specified OperationID with a StatusMessage.
|
||||
//
|
||||
// POST /operations/{OperationID}/failed
|
||||
func (svc *Service) ActionOperationFailed(ctx context.Context, params internal.ActionOperationFailedParams) (error) {
|
||||
pmap := datastore.Optional()
|
||||
pmap.Add("status_id", model.OperationStatusFailed)
|
||||
pmap.Add("status_message", params.StatusMessage)
|
||||
return svc.DB.Operations().Update(ctx, params.OperationID, pmap)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user