2022-10-07 02:54:09 +00:00
|
|
|
import { BaseAPI, route } from "../base";
|
2024-03-01 17:21:45 +00:00
|
|
|
import type {
|
2024-01-18 19:45:42 +00:00
|
|
|
CurrenciesCurrency,
|
|
|
|
Group,
|
|
|
|
GroupInvitation,
|
|
|
|
GroupInvitationCreate,
|
|
|
|
GroupUpdate,
|
|
|
|
} from "../types/data-contracts";
|
2022-10-07 02:54:09 +00:00
|
|
|
|
|
|
|
export class GroupApi extends BaseAPI {
|
|
|
|
createInvitation(data: GroupInvitationCreate) {
|
|
|
|
return this.http.post<GroupInvitationCreate, GroupInvitation>({
|
|
|
|
url: route("/groups/invitations"),
|
|
|
|
body: data,
|
|
|
|
});
|
|
|
|
}
|
2022-10-15 20:15:55 +00:00
|
|
|
|
|
|
|
update(data: GroupUpdate) {
|
|
|
|
return this.http.put<GroupUpdate, Group>({
|
|
|
|
url: route("/groups"),
|
|
|
|
body: data,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
get() {
|
|
|
|
return this.http.get<Group>({
|
|
|
|
url: route("/groups"),
|
|
|
|
});
|
|
|
|
}
|
2024-01-18 19:45:42 +00:00
|
|
|
|
|
|
|
currencies() {
|
|
|
|
return this.http.get<CurrenciesCurrency[]>({
|
|
|
|
url: route("/currencies"),
|
|
|
|
});
|
|
|
|
}
|
2022-10-07 02:54:09 +00:00
|
|
|
}
|