Skip to content

Commit e591799

Browse files
authored
Change api.delete to return proper "no content" (#331)
1 parent 7066ef4 commit e591799

8 files changed

+8
-8
lines changed

src/Lexers/ControllerLexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function resourceTokens()
125125
],
126126
'api.destroy' => [
127127
'delete' => '[singular]',
128-
'respond' => 200,
128+
'respond' => 204,
129129
],
130130
];
131131
}

tests/fixtures/controllers/certificate-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ public function destroy(Request $request, Certificate $certificate)
6464
{
6565
$certificate->delete();
6666

67-
return response()->noContent(200);
67+
return response()->noContent();
6868
}
6969
}

tests/fixtures/controllers/certificate-type-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ public function destroy(Request $request, CertificateType $certificateType)
6464
{
6565
$certificateType->delete();
6666

67-
return response()->noContent(200);
67+
return response()->noContent();
6868
}
6969
}

tests/fixtures/controllers/custom-models-namespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ public function destroy(Request $request, Tag $tag)
6464
{
6565
$tag->delete();
6666

67-
return response()->noContent(200);
67+
return response()->noContent();
6868
}
6969
}

tests/fixtures/tests/api-shorthand-validation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function destroy_deletes_and_responds_with()
144144

145145
$response = $this->delete(route('certificate.destroy', $certificate));
146146

147-
$response->assertOk();
147+
$response->assertNoContent();
148148

149149
$this->assertDeleted($certificate);
150150
}

tests/fixtures/tests/certificate-pascal-case-example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function destroy_deletes_and_responds_with()
144144

145145
$response = $this->delete(route('certificate.destroy', $certificate));
146146

147-
$response->assertOk();
147+
$response->assertNoContent();
148148

149149
$this->assertDeleted($certificate);
150150
}

tests/fixtures/tests/certificate-type-pascal-case-example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function destroy_deletes_and_responds_with()
119119

120120
$response = $this->delete(route('certificate-type.destroy', $certificateType));
121121

122-
$response->assertOk();
122+
$response->assertNoContent();
123123

124124
$this->assertDeleted($certificateType);
125125
}

tests/fixtures/tests/models-with-custom-namespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function destroy_deletes_and_responds_with()
131131

132132
$response = $this->delete(route('category.destroy', $category));
133133

134-
$response->assertOk();
134+
$response->assertNoContent();
135135

136136
$this->assertDeleted($category);
137137
}

0 commit comments

Comments
 (0)