File size: 791 Bytes
cce8120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import api from "../api";

export async function listProjects() {
    const { data } = await api.get("/api/projects");
    return data;
}

export async function getProject(id) {
    const { data } = await api.get(`/api/projects/${id}`);
    return data;
}

export async function createProject(payload) {
    const { data } = await api.post("/api/projects", payload);
    return data;
}

export async function updateProject(id, payload) {
    const { data } = await api.put(`/api/projects/${id}`, payload);
    return data;
}

export async function deleteProject(id) {
    const { data } = await api.delete(`/api/projects/${id}`);
    return data;
}

export async function saveFiles(id, files) {
    const { data } = await api.post(`/api/projects/${id}/files`, { files });
    return data;
}