summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
83cc752)
Updates API calls adding slashes where really needed.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>
constructor(serverApi: AxiosInstance, resourceType: string, actions: ApiActions) {
this.serverApi = serverApi;
constructor(serverApi: AxiosInstance, resourceType: string, actions: ApiActions) {
this.serverApi = serverApi;
- this.resourceType = '/' + resourceType + '/';
+ this.resourceType = '/' + resourceType;
this.actions = actions;
}
this.actions = actions;
}
delete(uuid: string): Promise<T> {
return CommonService.defaultResponse(
this.serverApi
delete(uuid: string): Promise<T> {
return CommonService.defaultResponse(
this.serverApi
- .delete(this.resourceType + uuid),
+ .delete(this.resourceType + '/' + uuid),
get(uuid: string) {
return CommonService.defaultResponse(
this.serverApi
get(uuid: string) {
return CommonService.defaultResponse(
this.serverApi
- .get<T>(this.resourceType + uuid),
+ .get<T>(this.resourceType + '/' + uuid),
update(uuid: string, data: Partial<T>) {
return CommonService.defaultResponse(
this.serverApi
update(uuid: string, data: Partial<T>) {
return CommonService.defaultResponse(
this.serverApi
- .put<T>(this.resourceType + uuid, data && CommonService.mapKeys(_.snakeCase)(data)),
+ .put<T>(this.resourceType + '/' + uuid, data && CommonService.mapKeys(_.snakeCase)(data)),
trash(uuid: string): Promise<T> {
return CommonResourceService.defaultResponse(
this.serverApi
trash(uuid: string): Promise<T> {
return CommonResourceService.defaultResponse(
this.serverApi
- .post(this.resourceType + `${uuid}/trash`),
+ .post(this.resourceType + `/${uuid}/trash`),
};
return CommonResourceService.defaultResponse(
this.serverApi
};
return CommonResourceService.defaultResponse(
this.serverApi
- .post(this.resourceType + `${uuid}/untrash`, {
+ .post(this.resourceType + `/${uuid}/untrash`, {
params: CommonResourceService.mapKeys(_.snakeCase)(params)
}),
this.actions
params: CommonResourceService.mapKeys(_.snakeCase)(params)
}),
this.actions
filters: filters ? `[${filters}]` : undefined,
order: order ? order : undefined
};
filters: filters ? `[${filters}]` : undefined,
order: order ? order : undefined
};
-
- const pathUrl = uuid ? `${uuid}/contents` : 'contents';
+ const pathUrl = uuid ? `/${uuid}/contents` : '/contents';
const cfg: AxiosRequestConfig = { params: CommonResourceService.mapKeys(_.snakeCase)(params) };
if (session) {
const cfg: AxiosRequestConfig = { params: CommonResourceService.mapKeys(_.snakeCase)(params) };
if (session) {
shared(params: SharedArguments = {}): Promise<ListResults<GroupContentsResource>> {
return CommonResourceService.defaultResponse(
this.serverApi
shared(params: SharedArguments = {}): Promise<ListResults<GroupContentsResource>> {
return CommonResourceService.defaultResponse(
this.serverApi
- .get(this.resourceType + 'shared', { params }),
+ .get(this.resourceType + '/shared', { params }),
activate(uuid: string) {
return CommonResourceService.defaultResponse(
this.serverApi
activate(uuid: string) {
return CommonResourceService.defaultResponse(
this.serverApi
- .post(this.resourceType + `${uuid}/activate`),
+ .post(this.resourceType + `/${uuid}/activate`),
unsetup(uuid: string) {
return CommonResourceService.defaultResponse(
this.serverApi
unsetup(uuid: string) {
return CommonResourceService.defaultResponse(
this.serverApi
- .post(this.resourceType + uuid + '/unsetup'),
+ .post(this.resourceType + `/${uuid}/unsetup`),