Skip to content

Commit 3b49835

Browse files
authored
Add missing responseAccepted method.
1 parent a6b5f66 commit 3b49835

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Controllers/ApiController.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ public function responseNoContent(
126126
return $this->setResponseCode(204)
127127
->respond(['message' => $message], $headers);
128128
}
129+
130+
/**
131+
* @param string $message
132+
* @param array $headers
133+
* @return JsonResponse
134+
*/
135+
public function responseAccepted(
136+
string $message = 'The request was accepted for processing',
137+
array $headers = []
138+
): JsonResponse {
139+
140+
return $this->setResponseCode(202)
141+
->setStatusCode(224)
142+
->respond(['message' => $message], $headers);
143+
}
129144

130145
/**
131146
* @param array $headers

0 commit comments

Comments
 (0)