WEBAPP NEW UI FIRST COMMIT
This commit is contained in:
52
resources/assets/js/api/Cases.js
Normal file
52
resources/assets/js/api/Cases.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import headerData from "./../mocks/casesHeader.json";
|
||||
import startedData from "./../mocks/startedCases.json";
|
||||
import inprogressData from "./../mocks/inprogressCases.json";
|
||||
import completedData from "./../mocks/completedCases.json";
|
||||
import supervisingData from "./../mocks/supervisingCases.json";
|
||||
|
||||
export let cases = {
|
||||
get(data) {
|
||||
if (data.type == "STARTED_BY_ME") {
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
resolutionFunc(startedData);
|
||||
});
|
||||
}
|
||||
if (data.type == "IN_PROGRESS") {
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
resolutionFunc(inprogressData);
|
||||
});
|
||||
}
|
||||
if (data.type == "COMPLETED") {
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
resolutionFunc(completedData);
|
||||
});
|
||||
}
|
||||
if (data.type == "SUPERVISING") {
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
resolutionFunc(supervisingData);
|
||||
});
|
||||
}
|
||||
},
|
||||
getPost(id) {
|
||||
return Client.get(`${resource}/${id}`);
|
||||
},
|
||||
create(payload) {
|
||||
return Client.post(`${resource}`, payload);
|
||||
},
|
||||
update(payload, id) {
|
||||
return Client.put(`${resource}/${id}`, payload);
|
||||
},
|
||||
delete(id) {
|
||||
return Client.delete(`${resource}/${id}`)
|
||||
}
|
||||
};
|
||||
|
||||
export let casesHeader = {
|
||||
get() {
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
resolutionFunc({
|
||||
data: headerData
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
9
resources/assets/js/api/Menu.js
Normal file
9
resources/assets/js/api/Menu.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import menuData from "./../mocks/menu.json";
|
||||
|
||||
export let menu = {
|
||||
get() {
|
||||
return new Promise((resolutionFunc, rejectionFunc) => {
|
||||
resolutionFunc(menuData);
|
||||
});
|
||||
},
|
||||
};
|
||||
9
resources/assets/js/api/index.js
Normal file
9
resources/assets/js/api/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
import { menu } from "./Menu";
|
||||
import { cases, casesHeader } from "./Cases";
|
||||
|
||||
export default {
|
||||
menu,
|
||||
cases,
|
||||
casesHeader
|
||||
};
|
||||
Reference in New Issue
Block a user