el.xwx.moe/lib/client/getPublicCollectionData.ts

17 lines
325 B
TypeScript
Raw Normal View History

2023-06-02 22:50:16 -05:00
const getPublicCollectionData = async (
collectionId: string,
setData?: Function
) => {
2023-05-29 14:40:23 -05:00
const res = await fetch(
"/api/public/routes/collections/?collectionId=" + collectionId
);
const data = await res.json();
2023-06-02 22:50:16 -05:00
if (setData) setData(data.response);
2023-05-29 14:40:23 -05:00
return data;
};
export default getPublicCollectionData;