File tree 4 files changed +10
-10
lines changed
4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -424,14 +424,14 @@ paths:
424
424
type : integer
425
425
example : 2462
426
426
description : The id of the newly created recipe
427
- 400 :
428
- description : There was no name in the request given for the recipe. Cannot save the recipe .
427
+ 409 :
428
+ description : A recipe with the name was already found on the server. No recipe is created .
429
429
content :
430
430
application/json :
431
431
schema :
432
432
$ref : " #/components/schemas/Error"
433
- 409 :
434
- description : A recipe with the name was already found on the server. No recipe is created .
433
+ 422 :
434
+ description : There was no name in the request given for the recipe. Cannot save the recipe .
435
435
content :
436
436
application/json :
437
437
schema :
@@ -479,7 +479,7 @@ paths:
479
479
type : integer
480
480
description : The id of the updated recipe
481
481
example : 2345
482
- 400 :
482
+ 422 :
483
483
description : There was no name in the request given for the recipe. Cannot save the recipe.
484
484
content :
485
485
application/json :
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public function update($id) {
109
109
'file ' => $ ex ->getFile (),
110
110
'line ' => $ ex ->getLine (),
111
111
];
112
- return new JSONResponse ($ json , Http::STATUS_BAD_REQUEST );
112
+ return new JSONResponse ($ json , Http::STATUS_UNPROCESSABLE_ENTITY );
113
113
}
114
114
$ this ->dbCacheService ->addRecipe ($ file );
115
115
@@ -148,7 +148,7 @@ public function create() {
148
148
'file ' => $ ex ->getFile (),
149
149
'line ' => $ ex ->getLine (),
150
150
];
151
- return new JSONResponse ($ json , Http::STATUS_BAD_REQUEST );
151
+ return new JSONResponse ($ json , Http::STATUS_UNPROCESSABLE_ENTITY );
152
152
}
153
153
}
154
154
Original file line number Diff line number Diff line change @@ -596,8 +596,8 @@ export default {
596
596
// Non 2xx state returned
597
597
598
598
switch (e .response .status ) {
599
- case 400 :
600
599
case 409 :
600
+ case 422 :
601
601
// eslint-disable-next-line no-alert
602
602
alert (e .response .data .msg )
603
603
break
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ public function testUpdateNoName(): void {
111
111
112
112
$ ret = $ this ->sut ->update (1 );
113
113
114
- $ this ->assertEquals (400 , $ ret ->getStatus ());
114
+ $ this ->assertEquals (422 , $ ret ->getStatus ());
115
115
$ this ->assertEquals ($ errorMsg , $ ret ->getData ()['msg ' ]);
116
116
}
117
117
@@ -154,7 +154,7 @@ public function testCreateNoName(): void {
154
154
155
155
$ ret = $ this ->sut ->create ();
156
156
157
- $ this ->assertEquals (400 , $ ret ->getStatus ());
157
+ $ this ->assertEquals (422 , $ ret ->getStatus ());
158
158
$ this ->assertEquals ($ errorMsg , $ ret ->getData ()['msg ' ]);
159
159
}
160
160
You can’t perform that action at this time.
0 commit comments