1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-07-14 09:44:16 +02:00

removed DrySubmit form errors wrapping and added more api tests

This commit is contained in:
Gani Georgiev
2022-11-01 00:28:33 +02:00
parent 5298543ce4
commit 9cef6ebd82
4 changed files with 32 additions and 8 deletions

View File

@ -227,14 +227,14 @@ func (api *recordApi) create(c echo.Context) error {
testErr := testForm.DrySubmit(func(txDao *daos.Dao) error {
foundRecord, err := txDao.FindRecordById(collection.Id, testRecord.Id, createRuleFunc)
if err != nil {
return err
return fmt.Errorf("DrySubmit create rule failure: %v", err)
}
hasFullManageAccess = hasAuthManageAccess(txDao, foundRecord, requestData)
return nil
})
if testErr != nil {
return NewBadRequestError("Failed to create record.", fmt.Errorf("DrySubmit error: %v", testErr))
return NewBadRequestError("Failed to create record.", testErr)
}
}