Connect CalDAV todos to DB-Items, finish todo component and add it to pipeline items
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import axios, { AxiosError } from 'axios';
|
||||
import { Todo } from '@/types';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
const API_URL = '/api/todos';
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Retrieves all notes
|
||||
* @returns Promise<Todo[] | null>
|
||||
*/
|
||||
async getTodosForModel(modelType: string, notableId: number): Promise<Todo[] | null> {
|
||||
try {
|
||||
const response = await axios.get<Todo[]>(`${API_URL}/${modelType}/${notableId}`)
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
toast.error('Fehler beim Laden der Aufgaben', { description: (error as AxiosError).message })
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
return null
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user