fix(canvas): 资源引用 - 校验递归素材并修复断链
This commit is contained in:
1 parent
5bbd208bef
commit
117fa7d70b
24 files changed
+697
-218
No files matched your search
@@ -293,8 +293,9 @@ func (s *Service) upsertUserCanvasProjectWithHistory(userID string, raw json.Raw
|
||||
if errors.Is(err, repository.ErrCanvasRevisionConflict) {
|
||||
return canvasRevisionConflict()
|
||||
}
|
||||
if errors.Is(err, repository.ErrCanvasHistoryResourceMissing) {
|
||||
return kernel.NewAppError(http.StatusConflict, "画布引用的素材已变化,当前内容未被覆盖,请保留草稿并重新加载")
|
||||
var missing *repository.CanvasHistoryResourceMissingError
|
||||
if errors.As(err, &missing) {
|
||||
return canvasResourcesMissingError(missing.References)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user