fix: Fix the problem of incorrect judgment error when uploading files

pull/143/head
1379 2 years ago
parent dd421497dd
commit 22ced7a1c2

@ -147,7 +147,7 @@ func (a *attachmentServiceImpl) Upload(ctx context.Context, fileHeader *multipar
WithStatus(xerr.StatusBadRequest).
WithMsg("附件路径为 " + attachmentDTO.Path + " 已经存在")
}
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
if !errors.Is(err, gorm.ErrRecordNotFound) {
return nil, WrapDBErr(err)
}
attachmentEntity := &entity.Attachment{

Loading…
Cancel
Save