Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

api.ts

13 lines356 Bytes

1import { HttpClient } from '@angular/common/http'
2import { Injectable, inject } from '@angular/core'
3import type { ProjectResponse } from './types'
4​
5@Injectable({
6 providedIn: 'root',
7})
8export class ProjectsAPI {
9 readonly #http = inject(HttpClient)
10​
11 getProjects = (page: number) =>
12 this.#http.get<ProjectResponse>(`/api/projects?page=${page}`)