mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-29 07:47:47 +01:00
a badly looking image cards thing
This commit is contained in:
14
frontend/src/redux/api/photos.ts
Normal file
14
frontend/src/redux/api/photos.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { IPhotoReqJSON } from "~../../src/entity/Photo";
|
||||
import { IPhotosListRespBody } from "~../../src/routes/photos";
|
||||
import { apiRoot } from "~env";
|
||||
import { fetchJSONAuth } from "./utils";
|
||||
|
||||
export function getPhotoImgPath(photo: IPhotoReqJSON): string {
|
||||
return `${apiRoot}/photos/showByID/${photo.id}/${photo.accessToken}`;
|
||||
}
|
||||
|
||||
export async function fetchPhotosList(): Promise<IPhotosListRespBody> {
|
||||
return (fetchJSONAuth("/photos/list", "GET") as unknown) as Promise<
|
||||
IPhotosListRespBody
|
||||
>;
|
||||
}
|
||||
Reference in New Issue
Block a user