mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-08 05:47:07 +09:00
GO-4459: Fix object delete error handling
This commit is contained in:
parent
aeed6dcaa2
commit
4b21551fdd
3 changed files with 5 additions and 5 deletions
|
@ -103,7 +103,7 @@ func DeleteObjectHandler(s *ObjectService) gin.HandlerFunc {
|
|||
code := util.MapErrorCode(err,
|
||||
util.ErrToCode(ErrObjectNotFound, http.StatusNotFound),
|
||||
util.ErrToCode(ErrFailedRetrieveObject, http.StatusInternalServerError),
|
||||
util.ErrToCode(ErrFailedDeleteObject, http.StatusInternalServerError),
|
||||
util.ErrToCode(ErrFailedDeleteObject, http.StatusForbidden),
|
||||
)
|
||||
|
||||
if code != http.StatusOK {
|
||||
|
|
|
@ -157,12 +157,12 @@ func (s *ObjectService) DeleteObject(ctx context.Context, spaceId string, object
|
|||
return Object{}, err
|
||||
}
|
||||
|
||||
resp := s.mw.ObjectListSetIsArchived(ctx, &pb.RpcObjectListSetIsArchivedRequest{
|
||||
ObjectIds: []string{objectId},
|
||||
resp := s.mw.ObjectSetIsArchived(ctx, &pb.RpcObjectSetIsArchivedRequest{
|
||||
ContextId: objectId,
|
||||
IsArchived: true,
|
||||
})
|
||||
|
||||
if resp.Error.Code != pb.RpcObjectListSetIsArchivedResponseError_NULL {
|
||||
if resp.Error.Code != pb.RpcObjectSetIsArchivedResponseError_NULL {
|
||||
return Object{}, ErrFailedDeleteObject
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ func (s *SearchService) Search(ctx context.Context, searchQuery string, objectTy
|
|||
Sorts: []*model.BlockContentDataviewSort{{
|
||||
RelationKey: bundle.RelationKeyLastModifiedDate.String(),
|
||||
Type: model.BlockContentDataviewSort_Desc,
|
||||
Format: model.RelationFormat_longtext,
|
||||
Format: model.RelationFormat_date,
|
||||
IncludeTime: true,
|
||||
EmptyPlacement: model.BlockContentDataviewSort_NotSpecified,
|
||||
}},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue