mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-30 17:47:24 +01:00
37 lines
815 B
TypeScript
37 lines
815 B
TypeScript
import { BaseAPI, route } from "../base";
|
|
import type {
|
|
CurrenciesCurrency,
|
|
Group,
|
|
GroupInvitation,
|
|
GroupInvitationCreate,
|
|
GroupUpdate,
|
|
} from "../types/data-contracts";
|
|
|
|
export class GroupApi extends BaseAPI {
|
|
createInvitation(data: GroupInvitationCreate) {
|
|
return this.http.post<GroupInvitationCreate, GroupInvitation>({
|
|
url: route("/groups/invitations"),
|
|
body: data,
|
|
});
|
|
}
|
|
|
|
update(data: GroupUpdate, groupId?: string) {
|
|
return this.http.put<GroupUpdate, Group>({
|
|
url: route(`/groups/${groupId || ""}`),
|
|
body: data,
|
|
});
|
|
}
|
|
|
|
get(groupId?: string) {
|
|
return this.http.get<Group>({
|
|
url: route(`/groups/${groupId || ""}`),
|
|
});
|
|
}
|
|
|
|
currencies() {
|
|
return this.http.get<CurrenciesCurrency[]>({
|
|
url: route("/currencies"),
|
|
});
|
|
}
|
|
}
|