remove Role entity and set language to pt-BR

This commit is contained in:
João Geonizeli
2022-07-26 14:40:46 -03:00
parent 9db59c071f
commit e24449adbc
22 changed files with 221 additions and 79 deletions

View File

@@ -0,0 +1,24 @@
type LocalFetch = typeof fetch
export const localFetch: LocalFetch = (input, init) => {
const { headers, ...rest } = init ?? {}
const crfsToken = document
.querySelector("[name='csrf-token']")
?.getAttribute('content')
if (!crfsToken) {
throw new Error('CSRF token not found')
}
const customInt: RequestInit = {
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': crfsToken,
...(headers ?? {}),
},
...rest,
}
return fetch(input, customInt)
}