1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { snakeCase } from 'lodash';
6 import { CommonResourceService } from "~/services/common-service/common-resource-service";
7 import { AxiosInstance } from "axios";
8 import { ContainerRequestResource } from '~/models/container-request';
9 import { ApiActions } from "~/services/api/api-actions";
11 export class ContainerRequestService extends CommonResourceService<ContainerRequestResource> {
12 constructor(serverApi: AxiosInstance, actions: ApiActions) {
13 super(serverApi, "container_requests", actions);
16 create(data?: Partial<ContainerRequestResource>) {
18 const { mounts } = data;
21 ...CommonResourceService.mapKeys(snakeCase)(data),
24 return CommonResourceService
26 this.serverApi.post<ContainerRequestResource>(this.resourceType, mappedData),
30 return CommonResourceService
33 .post<ContainerRequestResource>(this.resourceType, data && CommonResourceService.mapKeys(snakeCase)(data)),