select and delete multiple photos

This commit is contained in:
2022-05-02 22:03:06 +02:00
committed by Stepan Usatiuk
parent 3800f19768
commit ff058b7487
10 changed files with 277 additions and 94 deletions

View File

@@ -1,7 +1,7 @@
import { IPhotoReqJSON } from "../../../../src/entity/Photo";
import {
IPhotosByIDDeleteRespBody,
IPhotosByIDGetRespBody,
IPhotosDeleteRespBody,
IPhotosListRespBody,
IPhotosNewRespBody,
IPhotosUploadRespBody,
@@ -49,8 +49,8 @@ export async function uploadPhoto(
return fetchJSONAuth(`/photos/upload/${id}`, "POST", file);
}
export async function deletePhoto(
photo: IPhotoReqJSON,
): Promise<IPhotosByIDDeleteRespBody> {
return fetchJSONAuth(`/photos/byID/${photo.id}`, "DELETE");
export async function deletePhotos(
photos: IPhotoReqJSON[],
): Promise<IPhotosDeleteRespBody> {
return fetchJSONAuth(`/photos/delete`, "POST", { photos });
}