Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
// src/services/lps/SynonymGroupApiService.ts import type { SynonymGroup } from '@/shared/models/entities/Synonym'; import type { Pageable, Sort } from '@/shared/requests/Pageable'; import type { Search } from '@/shared/requests/Search'; import type { Page } from '@/shared/responses/Page'; import { ServiceCacher } from '../ServiceCacher'; import { AbstractLpsApiService } from './LpsApiService'; export interface SynonymGroupFilter extends Search, Pageable, Sort {} class SynonymGroupApiService extends AbstractLpsApiService { public constructor(lpsPortalUrl: string) { super('/synonym-groups', lpsPortalUrl); } public findAllPaged({ search }: SynonymGroupFilter = {}): Promise> { return this.http.get('', { params: { search } }) .then(this.handleResponse.bind(this)) .catch(this.handleError.bind(this)); } public findById(id: number): Promise { return this.http.get(`/${id}`) .then(this.handleResponse.bind(this)) .catch(this.handleError.bind(this)); } public create(content: SynonymGroup): Promise { return this.http.post('', content) .then(this.handleResponse.bind(this)) .catch(this.handleError.bind(this)); } public update(id: number, content: SynonymGroup): Promise { return this.http.put(`/${id}`, content) .then(this.handleResponse.bind(this)) .catch(this.handleError.bind(this)); } public delete(id: number): Promise { return this.http.delete(`/${id}`) .then(this.handleResponse.bind(this)) .catch(this.handleError.bind(this)); } } const serviceCacher: ServiceCacher = new ServiceCacher( nameof(), // https://github.com/dsherret/ts-nameof SynonymGroupApiService ); export function synonymGroupApiService(baseUrl: string): SynonymGroupApiService { return serviceCacher.instance(baseUrl); }