Skip to content

Commit

Permalink
fix(front): adjust getTags to server response
Browse files Browse the repository at this point in the history
  • Loading branch information
Lerri-Cofannos committed Oct 6, 2023
1 parent 09b8b22 commit 06986a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions front/src/services/nextAPI/TagsAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Tag } from "@prisma/client";

export const TagsAPI = {
getTags: async (): Promise<Tag[]> => {
const tagArray = await fetch("/api/tags", { method: "GET" }).then(
const response = await fetch("/api/tags", { method: "GET" }).then(
(res) => res.json(),
);
return safeCastToTagArray(tagArray);
return safeCastToTagArray(response.tags);
},
connectTagToLog: (logId: string, tagId: string): void => {
fetch(`/api/logs/${logId}/connectTag`, {
Expand Down

0 comments on commit 06986a5

Please sign in to comment.