chore: file formatting
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import apiClient from "@/api/client";
|
||||
import apiClient from '@/api/client';
|
||||
|
||||
export interface Blog {
|
||||
id?: number;
|
||||
@@ -9,7 +9,7 @@ export interface Blog {
|
||||
}
|
||||
|
||||
export const getAllBlogsApi = async () => {
|
||||
const res = await apiClient.get("/blogs");
|
||||
const res = await apiClient.get('/blogs');
|
||||
return res.data;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ export const getBlogByIdApi = async (id: number) => {
|
||||
};
|
||||
|
||||
export const createBlogApi = async (data: Blog) => {
|
||||
const res = await apiClient.post("/blogs", data);
|
||||
const res = await apiClient.post('/blogs', data);
|
||||
return res.data;
|
||||
};
|
||||
|
||||
@@ -36,11 +36,11 @@ export const deleteBlogApi = async (id: number) => {
|
||||
/* IMAGE UPLOAD */
|
||||
export const uploadImageApi = async (file: File) => {
|
||||
const formData = new FormData();
|
||||
formData.append("image", file);
|
||||
formData.append('image', file);
|
||||
|
||||
const res = await apiClient.post("/upload/image", formData, {
|
||||
const res = await apiClient.post('/upload/image', formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user