fix(model): 🐛 update enpoint for default rest ref
resolver
This commit is contained in:
parent
03aff06804
commit
6280b02934
|
@ -47,7 +47,7 @@ export class Ref<T extends Ressource> extends String {
|
||||||
static restResolver(endpoint: string | URL) {
|
static restResolver(endpoint: string | URL) {
|
||||||
return async <T extends Ressource>(ref: RefString<T>) => {
|
return async <T extends Ressource>(ref: RefString<T>) => {
|
||||||
const { type, uuid } = Ref.parse(ref)
|
const { type, uuid } = Ref.parse(ref)
|
||||||
const url = new URL(`${type}/${uuid}`, endpoint)
|
const url = new URL(`${type}s/${uuid}`, endpoint)
|
||||||
const response = await fetch(url)
|
const response = await fetch(url)
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue