2021-07-05 05:19:04 +02:00
|
|
|
import { get, DEFAULT_TIMEOUT, post, WRITE_TIMEOUT } from '../_utils/ajax.js'
|
|
|
|
import { auth, basename } from './utils.js'
|
2018-02-08 18:15:25 +01:00
|
|
|
|
2018-02-09 07:29:29 +01:00
|
|
|
export function getLists (instanceName, accessToken) {
|
2019-08-03 22:49:37 +02:00
|
|
|
const url = `${basename(instanceName)}/api/v1/lists`
|
2018-08-30 06:42:57 +02:00
|
|
|
return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
|
2018-02-09 07:29:29 +01:00
|
|
|
}
|
2020-08-26 07:16:14 +02:00
|
|
|
|
|
|
|
export function createList (instanceName, accessToken, title) {
|
|
|
|
const url = `${basename(instanceName)}/api/v1/lists`
|
|
|
|
return post(url, { title }, auth(accessToken), { timeout: WRITE_TIMEOUT })
|
|
|
|
}
|