API Job
Add: - api-client/api-job: kumpulan fetch api Fix: - UI beranda , status sudah terintergrasi dengan API - UI detail status, detail utama sudah terintergrasi dengan API - Search pada beranda sudah terintegrasi - Edit sudah terintergrasi ### No Issue
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { API_BASE_URL } from "@/service/api-config";
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||
import { apiFileUpload } from "./api-client/api-file";
|
||||
import { apiFileDelete, apiFileUpload } from "./api-client/api-file";
|
||||
|
||||
export async function uploadImageService({
|
||||
dirId,
|
||||
@@ -49,3 +49,18 @@ export async function uploadImageService({
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteImageService({ id }: { id: string }) {
|
||||
const token = await AsyncStorage.getItem("authToken");
|
||||
|
||||
try {
|
||||
const response = await apiFileDelete({
|
||||
id: id,
|
||||
token: token as string,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user