mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
18 lines
504 B
TypeScript
18 lines
504 B
TypeScript
import { BackendProject, Team } from '../types';
|
|
|
|
export interface BackendProjectWithTeams extends BackendProject {
|
|
teams: Team[];
|
|
}
|
|
|
|
export interface BackendProjectWithTeam extends BackendProject {
|
|
team: Team;
|
|
}
|
|
|
|
export const normalizeBackendProjectTeam = (backend: BackendProjectWithTeams): BackendProjectWithTeam => ({
|
|
id: backend.id,
|
|
name: backend.name,
|
|
rootDocumentId: backend.rootDocumentId,
|
|
// A backend project is guaranteed to exist on exactly one team
|
|
team: backend.teams[0],
|
|
});
|