From 1b199882791aaed4d5f75a194e7303fa45ff0179 Mon Sep 17 00:00:00 2001 From: Toast Date: Tue, 4 Feb 2025 14:14:44 +0100 Subject: [PATCH] Services/shows: add function to remove show --- src/interfaces/shows-api-deletion.ts | 4 ++++ src/services/shows/shows-api.service.ts | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 src/interfaces/shows-api-deletion.ts diff --git a/src/interfaces/shows-api-deletion.ts b/src/interfaces/shows-api-deletion.ts new file mode 100644 index 0000000..207da69 --- /dev/null +++ b/src/interfaces/shows-api-deletion.ts @@ -0,0 +1,4 @@ +export interface ShowsApiDeletion { + status: string + message: string +} diff --git a/src/services/shows/shows-api.service.ts b/src/services/shows/shows-api.service.ts index d2f0e2e..3ef5a39 100644 --- a/src/services/shows/shows-api.service.ts +++ b/src/services/shows/shows-api.service.ts @@ -4,6 +4,7 @@ import {Observable} from 'rxjs'; import {ShowsApiResponse} from '../../interfaces/shows-api-response'; import {ShowsApiCreation} from '../../interfaces/shows-api-creation'; import {ShowsApiIdResponse} from '../../interfaces/shows-api-id-response'; +import {ShowsApiDeletion} from '../../interfaces/shows-api-deletion'; @Injectable({ providedIn: 'root' @@ -29,4 +30,8 @@ export class ShowsApiService { sendShow(newShow: {}) { return this.http.post(this.showsEndpoint, newShow) } + + deleteShw(id: string): Observable { + return this.http.delete(this.showsEndpoint + "id/" + id) + } }