upd: tambah anggota task
Deskripsi: -tambah anggota task NO ISsues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IFormAddDetailTask, IFormDateTask, IFormTaskDivision } from "./type_task";
|
||||
import { IFormAddDetailTask, IFormAddMemberTask, IFormDateTask, IFormTaskDivision } from "./type_task";
|
||||
|
||||
export const funGetAllTask = async (path?: string) => {
|
||||
const response = await fetch(`/api/task${(path) ? path : ''}`, { next: { tags: ['task'] } });
|
||||
@@ -76,4 +76,15 @@ export const funCreateDetailTask = async (path: string, data: IFormAddDetailTask
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
export const funAddMemberTask = async (path: string, data: IFormAddMemberTask) => {
|
||||
const response = await fetch(`/api/task/${path}/member`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
@@ -27,6 +27,12 @@ export interface IFormAddDetailTask {
|
||||
}
|
||||
|
||||
|
||||
export interface IFormAddMemberTask {
|
||||
idDivision: string
|
||||
member: IFormMemberTask[] | []
|
||||
}
|
||||
|
||||
|
||||
export interface IFormTaskDivision {
|
||||
idDivision: string
|
||||
title: string
|
||||
@@ -51,6 +57,7 @@ export interface IDataListTaskDivision {
|
||||
|
||||
export interface IDataMemberTaskDivision {
|
||||
id: string
|
||||
idUser: string
|
||||
name: string
|
||||
email: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user