mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 08:04:45 -04:00
feat: extend api request builder with custom base url
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
ca586413d2
commit
8977100830
5 changed files with 26 additions and 4 deletions
frontend/src/api/common/api-request-builder
|
@ -19,6 +19,11 @@ describe('PutApiRequestBuilder', () => {
|
|||
global.fetch = originalFetch
|
||||
})
|
||||
|
||||
it('uses the custom base url as prefix', async () => {
|
||||
expectFetch('https://example.org/api/private/test', 200, { method: 'PUT' })
|
||||
await new PutApiRequestBuilder<string, undefined>('test', 'https://example.org/').sendRequest()
|
||||
})
|
||||
|
||||
describe('sendRequest without body', () => {
|
||||
it('without headers', async () => {
|
||||
expectFetch('api/private/test', 200, { method: 'PUT' })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue