mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 23:00:08 +02:00
12 lines
393 B
TypeScript
12 lines
393 B
TypeScript
import { GetTemplatesResponseBody, Sort } from '../types/api'
|
|
import { getJSON } from '../../../infrastructure/fetch-json'
|
|
|
|
export function getTemplates(sortBy: Sort, category: string): Promise<GetTemplatesResponseBody> {
|
|
const queryParams = new URLSearchParams({
|
|
by: sortBy.by,
|
|
order: sortBy.order,
|
|
category,
|
|
}).toString()
|
|
|
|
return getJSON(`/api/templates?${queryParams}`)
|
|
}
|