diff --git a/src/module/banner/lib/api_banner.ts b/src/module/banner/lib/api_banner.ts index df174ae..9c969f0 100644 --- a/src/module/banner/lib/api_banner.ts +++ b/src/module/banner/lib/api_banner.ts @@ -1,3 +1,8 @@ +export const funGetAllBanner = async (path?: string) => { + const response = await fetch(`/api/banner${(path) ? path : ''}`, { next: { tags: ['banner'] } }); + return await response.json().catch(() => null); +} + export const funDeleteBanner = async (path: string) => { const response = await fetch(`/api/banner/${path}`, { method: "DELETE", @@ -6,4 +11,26 @@ export const funDeleteBanner = async (path: string) => { }, }); return await response.json().catch(() => null); -}; \ No newline at end of file +}; + +export const funCreateBanner = async (data: FormData) => { + const response = await fetch(`/api/banner`, { + method: "POST", + body: data, + }); + return await response.json().catch(() => null); +} + +export const funGetOneBanner = async (path: string) => { + const response = await fetch(`/api/banner/${path}`) + return await response.json().catch(() => null); +} + +export const funEditBanner = async (path: string, data: FormData) => { + const response = await fetch(`/api/banner/${path}`, { + method: "PUT", + body: data, + }); + return await response.json().catch(() => null); +} + diff --git a/src/module/banner/lib/git.keep b/src/module/banner/lib/git.keep deleted file mode 100644 index e69de29..0000000