upd: project
Deskripsi: - detail project - batal project - edit project - tambah tugas project - update status tugas project No Issues'
This commit is contained in:
25
lib/api.ts
25
lib/api.ts
@@ -236,4 +236,29 @@ export const apiDeleteAnnouncement = async (data: { user: string }, id: string)
|
||||
export const apiGetProject = async ({ user, status, search, group, kategori }: { user: string, status: string, search: string, group?: string, kategori?: string }) => {
|
||||
const response = await api.get(`mobile/project?user=${user}&status=${status}&group=${group}&search=${search}&cat=${kategori}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetProjectOne = async ({ user, cat, id }: { user: string, cat: 'data' | 'progress' | 'task' | 'file' | 'member', id: string }) => {
|
||||
const response = await api.get(`mobile/project/${id}?user=${user}&cat=${cat}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiEditProject = async (data: { name: string, user: string }, id: string) => {
|
||||
const response = await api.put(`/mobile/project/${id}`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiCreateProjectTask = async ({ data, id }: { data: { name: string, dateStart: Date, user: string, dateEnd: Date }, id: string }) => {
|
||||
const response = await api.post(`/mobile/project/${id}`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiCancelProject = async (data: { user: string, reason: string }, id: string) => {
|
||||
const response = await api.delete(`mobile/project/${id}`, { data })
|
||||
return response.data
|
||||
};
|
||||
|
||||
export const apiUpdateStatusProjectTask = async (data: { user: string, status: number, idProject: string }, id: string) => {
|
||||
const response = await api.put(`mobile/project/detail/${id}`, data)
|
||||
return response.data
|
||||
};
|
||||
20
lib/projectUpdate.ts
Normal file
20
lib/projectUpdate.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const projectUpdate = createSlice({
|
||||
name: 'projectUpdate',
|
||||
initialState: {
|
||||
data: false,
|
||||
progress: false,
|
||||
task: false,
|
||||
file: false,
|
||||
member: false
|
||||
},
|
||||
reducers: {
|
||||
setUpdateProject: (state, action) => {
|
||||
return action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setUpdateProject } = projectUpdate.actions;
|
||||
export default projectUpdate.reducer;
|
||||
@@ -8,6 +8,7 @@ import groupUpdate from './groupSlice';
|
||||
import memberChoose from './memberChoose';
|
||||
import memberUpdate from './memberSlice';
|
||||
import positionUpdate from './positionSlice';
|
||||
import projectUpdate from './projectUpdate';
|
||||
import userReducer from './userSlice';
|
||||
|
||||
const store = configureStore({
|
||||
@@ -21,7 +22,8 @@ const store = configureStore({
|
||||
filterGroup: filterSlice,
|
||||
discussionGeneralDetailUpdate: discussionGeneralDetailUpdate,
|
||||
memberChoose: memberChoose,
|
||||
announcementUpdate: announcementUpdate
|
||||
announcementUpdate: announcementUpdate,
|
||||
projectUpdate: projectUpdate,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user