diff --git a/frontend/src/lib/api/cardsApi.ts b/frontend/src/lib/api/cardsApi.ts index c9625e3..ebc944d 100644 --- a/frontend/src/lib/api/cardsApi.ts +++ b/frontend/src/lib/api/cardsApi.ts @@ -17,11 +17,16 @@ async function create(projectId: number): Promise { return response.data.id; } -async function update(card: Card): Promise { - const response = await api.put(`/v1/cards/${card.id}`, { - project_id: card.project_id, - title: card.title, - content: card.content +async function update( + cardId: number, + projectId: number, + title: string, + content: string +): Promise { + const response = await api.put(`/v1/cards/${cardId}`, { + project_id: projectId, + title: title, + content: content }); if (response.status !== status.NoContent) { diff --git a/frontend/src/lib/api/projectTagsApi.ts b/frontend/src/lib/api/projectTagsApi.ts index 8b1d3ff..41e8eb2 100644 --- a/frontend/src/lib/api/projectTagsApi.ts +++ b/frontend/src/lib/api/projectTagsApi.ts @@ -4,9 +4,9 @@ import TagOption from '$lib/types/TagOption'; import api, { processError } from '$lib/utils/api'; import status from '$lib/utils/status'; -async function create(project: Project, title: string, type: number): Promise { +async function create(projectId: number, title: string, type: number): Promise { const response = await api.post(`/v1/tags/`, { - project_id: project.id, + project_id: projectId, title, type }); @@ -19,8 +19,11 @@ async function create(project: Project, title: string, type: number): Promise { - const response = await api.put(`/v1/tags/${tag.id}`, tag); +async function update(tagId: number, title: string, type: number): Promise { + const response = await api.put(`/v1/tags/${tagId}`, { + title, + type + }); if (response.status !== status.NoContent) { processError(response, 'Failed to update tag'); diff --git a/frontend/src/lib/components/card/Card.svelte b/frontend/src/lib/components/card/Card.svelte index 38de2ae..edf0529 100644 --- a/frontend/src/lib/components/card/Card.svelte +++ b/frontend/src/lib/components/card/Card.svelte @@ -2,7 +2,7 @@ import currentDraggedCard from '$lib/stores/currentDraggedCard'; import currentModalCard from '$lib/stores/currentModalCard'; import type Card from '$lib/types/Card'; - // import ModalCard from './ModalCard.svelte'; + import ModalCard from './ModalCard.svelte'; export let card: Card; @@ -34,7 +34,7 @@ - +