mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
18 lines
440 B
TypeScript
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],
|
|
});
|