1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-11-25 15:42:01 +02:00

[#2287] fixed unique field detailed error not being returned on DrySubmit failure

This commit is contained in:
Gani Georgiev
2023-04-13 22:37:10 +03:00
parent 35e433f26b
commit 8317ae2e6b
3 changed files with 18 additions and 6 deletions

View File

@@ -1173,6 +1173,20 @@ func TestRecordCrudCreate(t *testing.T) {
"OnModelAfterCreate": 1,
},
},
{
Name: "unique field error check",
Method: http.MethodPost,
Url: "/api/collections/demo2/records",
Body: strings.NewReader(`{
"title":"test2"
}`),
ExpectedStatus: 400,
ExpectedContent: []string{
`"data":{`,
`"title":{`,
`"code":"validation_not_unique"`,
},
},
// ID checks
// -----------------------------------------------------------