diff --git a/frontend/src/api.ts b/frontend/src/api.ts index f6128bd..13a3b70 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -332,7 +332,7 @@ import type { DbPicture, DbObject, DbWord, DbPair } from './types' export async function getDesignOptions(token: string): Promise<{ text: string; value: string; color?: string }[]> { const res = await fetch('/api/directus/db-pictures/design-options', { - headers: { Authorization: token }, + headers: { Authorization: `Bearer ${token}` }, }) const data = await res.json() return data.choices || [] @@ -483,7 +483,7 @@ export async function addDbObjectWord( ) { const res = await fetch(`/api/directus/db-objects/${objectId}/words`, { method: 'POST', - headers: { 'Content-Type': 'application/json', Authorization: token }, + headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, body: JSON.stringify(word), }) return res.json() @@ -497,7 +497,7 @@ export async function deleteDbObjectWord( ) { const res = await fetch(`/api/directus/db-objects/${objectId}/words/${junctionId}`, { method: 'DELETE', - headers: { Authorization: token }, + headers: { Authorization: `Bearer ${token}` }, }) return res.json() } @@ -510,7 +510,7 @@ export async function addDbPictureWord( ) { const res = await fetch(`/api/directus/db-pictures/${pictureId}/words`, { method: 'POST', - headers: { 'Content-Type': 'application/json', Authorization: token }, + headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, body: JSON.stringify({ words: [word] }), }) return res.json() @@ -524,7 +524,7 @@ export async function deleteDbPictureWord( ) { const res = await fetch(`/api/directus/db-pictures/${pictureId}/words/${junctionId}`, { method: 'DELETE', - headers: { Authorization: token }, + headers: { Authorization: `Bearer ${token}` }, }) return res.json() }