2022-10-07 02:54:09 +00:00
|
|
|
import { BaseAPI, route } from "../base";
|
2024-01-05 17:59:08 +00:00
|
|
|
import {
|
|
|
|
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-05 17:59:08 +00:00
|
|
|
|
|
|
|
currencies() {
|
|
|
|
return this.http.get<CurrenciesCurrency[]>({
|
|
|
|
url: route("/currencies"),
|
|
|
|
});
|
|
|
|
}
|
2022-10-07 02:54:09 +00:00
|
|
|
}
|