This repository has been archived on 2026-02-22. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
web/src/api/v1.ts
2021-12-29 19:44:08 +01:00

15 lines
284 B
TypeScript

const API_PREFIX = '/api/v1'
export class RbApi {
async get_json (path) {
const url = `${API_PREFIX}${path}`
const res = await fetch(url)
return await res.json()
}
async sections () {
const res = await this.get_json('/sections')
return res.sections
}
}