add projects detail page, task create / delete

This commit is contained in:
Gregor Vostrak
2024-04-08 18:41:04 +02:00
parent 0081aa7a6e
commit 5293bc7a05
32 changed files with 733 additions and 215 deletions

View File

@@ -24,6 +24,8 @@ export type CreateProjectBody = ZodiosBodyByAlias<
'createProject'
>;
export type CreateTaskBody = ZodiosBodyByAlias<SolidTimeApi, 'createTask'>;
export type CreateClientBody = ZodiosBodyByAlias<SolidTimeApi, 'createClient'>;
export type TagIndexResponse = ZodiosResponseByAlias<SolidTimeApi, 'getTags'>;

View File

@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import { getCurrentOrganizationId } from '@/utils/useUser';
import { api } from '../../../openapi.json.client';
import { reactive, ref } from 'vue';
import type { Task } from '@/utils/api';
import type { CreateTaskBody, Task } from '@/utils/api';
export const useTasksStore = defineStore('tasks', () => {
const tasks = ref<Task[]>(reactive([]));
@@ -31,7 +31,7 @@ export const useTasksStore = defineStore('tasks', () => {
}
}
async function createTask(task: Task) {
async function createTask(task: CreateTaskBody) {
const organizationId = getCurrentOrganizationId();
if (organizationId) {
await api.createTask(task, {