mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
Add prettier for codestyle and re-format everything (#1294)
This commit is contained in:
parent
8b78154075
commit
0aae1f70d2
319 changed files with 4809 additions and 3936 deletions
|
@ -8,25 +8,25 @@ import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
|
|||
import { AccessToken, AccessTokenSecret } from './types'
|
||||
|
||||
export const getAccessTokenList = async (): Promise<AccessToken[]> => {
|
||||
const response = await fetch(`${ getApiUrl() }tokens`, {
|
||||
const response = await fetch(`${getApiUrl()}tokens`, {
|
||||
...defaultFetchConfig
|
||||
})
|
||||
expectResponseCode(response)
|
||||
return await response.json() as AccessToken[]
|
||||
return (await response.json()) as AccessToken[]
|
||||
}
|
||||
|
||||
export const postNewAccessToken = async (label: string): Promise<AccessToken & AccessTokenSecret> => {
|
||||
const response = await fetch(`${ getApiUrl() }tokens`, {
|
||||
const response = await fetch(`${getApiUrl()}tokens`, {
|
||||
...defaultFetchConfig,
|
||||
method: 'POST',
|
||||
body: label
|
||||
})
|
||||
expectResponseCode(response)
|
||||
return await response.json() as (AccessToken & AccessTokenSecret)
|
||||
return (await response.json()) as AccessToken & AccessTokenSecret
|
||||
}
|
||||
|
||||
export const deleteAccessToken = async (timestamp: number): Promise<void> => {
|
||||
const response = await fetch(`${ getApiUrl() }tokens/${ timestamp }`, {
|
||||
const response = await fetch(`${getApiUrl()}tokens/${timestamp}`, {
|
||||
...defaultFetchConfig,
|
||||
method: 'DELETE'
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue