feat(front): aligner api platform et sessions [INV-20260111-02]

This commit is contained in:
2026-01-11 17:14:24 +01:00
parent 936a73fde3
commit e99f053233
17 changed files with 346 additions and 67 deletions

View File

@@ -10,6 +10,7 @@ export function useApi () {
const apiCall = async (endpoint, options = {}) => {
const url = `${API_BASE_URL}${endpoint}`
const defaultOptions = {
credentials: 'include',
headers: {
'Content-Type': 'application/json'
}
@@ -32,7 +33,7 @@ export function useApi () {
let data = null
if (response.status !== 204) {
const contentType = response.headers.get('content-type') || ''
if (contentType.includes('application/json')) {
if (contentType.includes('application/json') || contentType.includes('application/ld+json') || contentType.includes('+json')) {
const text = await response.text()
data = text ? JSON.parse(text) : null
} else {