Skip to content

Commit

Permalink
Merge pull request #107 from observerly/refactor/client/camera/shutdown
Browse files Browse the repository at this point in the history
refactor: amend client.camera.shutdown() in @observerly/hyper.
  • Loading branch information
michealroberts authored Apr 13, 2024
2 parents f26c9ee + 5103eae commit 1ab7ecf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/routes/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const camera = (base: URL, init?: RequestInit, headers?: () => Promise<He
>() => {
const url = new URL('camera/shutdown', base)

return dispatchRequest<T>(url, { ...init, method: 'PUT' }, headers)
return dispatchRequest<T>(url, { ...init, method: 'DELETE' }, headers)
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions tests/mocks/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export const cameraHandlers: Handler[] = [
})
},
{
method: 'PUT',
method: 'DELETE',
url: '/api/v1/camera/shutdown',
handler: eventHandler(event => {
const method = getMethod(event)

if (method !== 'PUT') {
if (method !== 'DELETE') {
return new Response('Method Not Allowed', {
status: 405,
statusText: 'Method Not Allowed'
Expand Down

0 comments on commit 1ab7ecf

Please sign in to comment.