Co-authored-by: James <james@trbl.design> Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
18 lines
360 B
TypeScript
18 lines
360 B
TypeScript
export class AdminUrlUtil {
|
|
admin: string;
|
|
|
|
collection: string;
|
|
|
|
create: string;
|
|
|
|
constructor(serverURL: string, slug: string) {
|
|
this.admin = `${serverURL}/admin`;
|
|
this.collection = `${this.admin}/collections/${slug}`;
|
|
this.create = `${this.collection}/create`;
|
|
}
|
|
|
|
doc(id: string): string {
|
|
return `${this.collection}/${id}`;
|
|
}
|
|
}
|