1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { serverApi } from "../../common/server-api";
6 import { Dispatch } from "redux";
7 import actions from "../../store/project/project-action";
8 import { Project } from "../../models/project";
10 interface GroupsResponse {
20 modified_by_client_uuid: string;
21 modified_by_user_uuid: string;
26 writable_by: string[];
33 export default class ProjectService {
34 public getTopProjectList = () => (dispatch: Dispatch) => {
35 dispatch(actions.TOP_PROJECTS_REQUEST());
36 serverApi.get<GroupsResponse>('/groups').then(groups => {
37 const projects = groups.data.items.map(g => ({
39 createdAt: g.created_at,
40 modifiedAt: g.modified_at,
43 ownerUuid: g.owner_uuid
45 dispatch(actions.TOP_PROJECTS_SUCCESS(projects));