Files
List_ultimate/app/repositories/lists.repository.ts
2026-02-26 21:29:34 +01:00

22 lines
426 B
TypeScript

import type { $Fetch } from 'ofetch';
import type { List } from '~/types/lists'
export default class ListRepository {
private fetcher: $Fetch;
constructor(fetcher: $Fetch) {
this.fetcher = fetcher;
}
async getAll() {
return await this.fetcher<List[]>('/lists');
}
async create(data: Partial<List>) {
return await this.fetcher<List>('/lists', {
method: 'POST',
body: data
});
}
}