15781: Replaces 'like' operator with '=' on fallback property matches.
[arvados-workbench2.git] / src / services / project-service / project-service.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { GroupsService } from "../groups-service/groups-service";
6 import { ProjectResource } from "~/models/project";
7 import { GroupClass } from "~/models/group";
8 import { ListArguments } from "~/services/common-service/common-service";
9 import { FilterBuilder, joinFilters } from "~/services/api/filter-builder";
10 export class ProjectService extends GroupsService<ProjectResource> {
11
12     create(data: Partial<ProjectResource>) {
13         const projectData = { ...data, groupClass: GroupClass.PROJECT };
14         return super.create(projectData);
15     }
16
17     list(args: ListArguments = {}) {
18         return super.list({
19             ...args,
20             filters: joinFilters(
21                 args.filters || '',
22                 new FilterBuilder()
23                     .addEqual("group_class", GroupClass.PROJECT)
24                     .getFilters()
25             )
26         });
27     }
28 }