This commit is contained in:
2026-06-17 10:47:21 +07:00
parent f8cdef0663
commit 8e49e1c85c
3 changed files with 76 additions and 0 deletions

View File

@ -105,4 +105,26 @@ export default class Thirdparty {
};
}
}
static async DeleteFile(url: string, field: any, token?: string) {
try {
const headers: Record<string, string> = {};
if (token) {
headers.Authorization = `Bearer ${token}`;
}
const response = await axios.delete(url, { data: field, headers });
const result = response.data;
if (!result.status) throw response;
return result;
} catch (error: any) {
const { response } = error;
throw {
status: false,
message: response?.data?.error ?? response?.data?.message ?? "Unknown error",
data: null,
};
}
}
}