change return values in AppService.ts -> JSON

develop
TBS093A 2020-07-21 13:58:12 +02:00
parent 74d7cc50c4
commit 55f4ffe006
1 changed files with 6 additions and 6 deletions

View File

@ -19,27 +19,27 @@ export class AbstractService<T> {
return response.json()
}
public async getList(endpoint: string) : Promise< Array<T> > {
public async getList(endpoint: string) : Promise<JSON> {
return await this.responseGD(address + endpoint, 'GET')
}
public async getOne(endpoint: string) : Promise<T> {
public async getOne(endpoint: string) : Promise<JSON> {
return await this.responseGD(address + endpoint, 'GET')
}
public async post(endpoint: string, body: T) : Promise<T> {
public async post(endpoint: string, body: T) : Promise<JSON> {
return await this.responseCRU(address + endpoint, 'POST', body)
}
public async put(endpoint: string, body: T) : Promise<T> {
public async put(endpoint: string, body: T) : Promise<JSON> {
return await this.responseCRU(address + endpoint, 'PUT', body)
}
public async patch(endpoint: string, body: T) : Promise<T> {
public async patch(endpoint: string, body: T) : Promise<JSON> {
return await this.responseCRU(address + endpoint, 'PATCH', body)
}
public async delete(endpoint: string) : Promise<T> {
public async delete(endpoint: string) : Promise<JSON> {
return await this.responseGD(address + endpoint, 'DELETE')
}
}