17 lines
573 B
TypeScript
17 lines
573 B
TypeScript
import { api as api } from '../../api';
|
|
import { presentSponsor } from '../../presenters';
|
|
import { SponsorViewModel } from '../../view-models';
|
|
|
|
export async function getAllSponsors(): Promise<SponsorViewModel[]> {
|
|
const dto = await api.sponsors.getAll();
|
|
return dto.sponsors.map(s => presentSponsor(s));
|
|
}
|
|
|
|
export async function createSponsor(input: any): Promise<any> {
|
|
return await api.sponsors.create(input);
|
|
}
|
|
|
|
export async function getSponsorDashboard(sponsorId: string): Promise<any> {
|
|
const dto = await api.sponsors.getDashboard(sponsorId);
|
|
return dto;
|
|
} |