idz: Clean up Team and TeamMember data models

This commit is contained in:
Tau
2019-11-06 17:28:30 -05:00
parent 85510ee0e1
commit 33e2f55dce
12 changed files with 84 additions and 47 deletions
+12 -4
View File
@@ -6,15 +6,23 @@ import { JoinAutoTeamResponse } from "../response/joinAutoTeam";
import { LoadTeamResponse } from "../response/loadTeam";
import { Repositories } from "../repo";
// Even if a profile does not belong to a team, a team must still be loaded
// (and then ignored by the client).
const dummy: Team = {
extId: 0 as ExtId<Team>,
name: "",
nameBg: 0,
nameFx: 0,
registerTime: new Date(0),
};
export function _team(
w: Repositories,
req: JoinAutoTeamRequest | LoadTeamRequest
): JoinAutoTeamResponse | LoadTeamResponse {
const bits = {
team: {
id: 2 as ExtId<Team>,
name: process.env.TEAM_NAME || "",
},
team: dummy,
members: [],
};
+1 -1
View File
@@ -11,6 +11,6 @@ export function createTeam(
return {
type: "create_team_res",
status: 0,
teamId: 3 as ExtId<Team>,
teamExtId: 3 as ExtId<Team>,
};
}