insomnia/packages/insomnia-app/app/sync/vcs/normalize-project-team.ts
2021-08-08 05:08:56 +00:00

18 lines
440 B
TypeScript

import { Project, Team } from '../types';
export interface ProjectWithTeams extends Project {
teams: Team[];
}
export interface ProjectWithTeam extends Project {
team: Team;
}
export const normalizeProjectTeam = (project: ProjectWithTeams): ProjectWithTeam => ({
id: project.id,
name: project.name,
rootDocumentId: project.rootDocumentId,
// A project is guaranteed to exist on exactly one team
team: project.teams[0],
});