Connect CalDAV todos to DB-Items, finish todo component and add it to pipeline items
This commit is contained in:
@@ -21,4 +21,36 @@ export default {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a new pipeline item
|
||||
* @param item
|
||||
* @returns
|
||||
*/
|
||||
async createPipelineItem(item: PipelineItem): Promise<PipelineItem | null> {
|
||||
try {
|
||||
const response = await axios.post(ITEMS_API_URL, item);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
toast.error('Fehler beim Speichern des Vorgangs', { description: (error as AxiosError).message })
|
||||
console.error(error)
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates an existing pipeline item
|
||||
* @param item
|
||||
* @returns
|
||||
*/
|
||||
async updatePipelineItem(item: PipelineItem): Promise<PipelineItem | null> {
|
||||
try {
|
||||
const response = await axios.put(ITEMS_API_URL + '/' + item.id, item);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
toast.error('Fehler beim Speichern des Vorgangs', { description: (error as AxiosError).message })
|
||||
console.error(error)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user