Add TodoItem component, enhance task list, and improve API data handling
- Introduced `TodoItem.vue`, a reusable component for task items. - Refactored `ListScreen` to use `TodoItem` for better modularity. - Added new animations and styles for smooth transitions. - Updated `useTasks` with `updateTask` method to sync task updates via API. - Improved type definitions for `Task` and added nullable fields for flexibility. - Added dependencies: `luxon`, `@types/luxon`, `uuid`, and `@vueuse/core`.
This commit is contained in:
@@ -51,10 +51,10 @@ export function useApi() {
|
||||
const get = (endpoint: string, options: RequestInit = {}) =>
|
||||
apiFetch(endpoint, { ...options, method: 'GET' });
|
||||
|
||||
const post = (endpoint: string, body: BodyInit | null, options: RequestInit = {}) =>
|
||||
const post = (endpoint: string, body: unknown, options: RequestInit = {}) =>
|
||||
apiFetch(endpoint, { ...options, method: 'POST', body: JSON.stringify(body) });
|
||||
|
||||
const put = (endpoint: string, body: BodyInit | null, options: RequestInit = {}) =>
|
||||
const put = (endpoint: string, body: unknown, options: RequestInit = {}) =>
|
||||
apiFetch(endpoint, { ...options, method: 'PUT', body: JSON.stringify(body) });
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user