Made Mission marker DB compatible
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { Station, User } from "../../generated/client";
|
||||
import { PublicUser } from "./User";
|
||||
|
||||
export interface MissionStationLog {
|
||||
type: "station-log";
|
||||
auto: true;
|
||||
timeStamp: string;
|
||||
data: {
|
||||
stationId: string;
|
||||
oldFMSstatus: string;
|
||||
@@ -15,9 +17,11 @@ export interface MissionStationLog {
|
||||
export interface MissionMessageLog {
|
||||
type: "message-log";
|
||||
auto: false;
|
||||
timeStamp: string;
|
||||
|
||||
data: {
|
||||
message: string;
|
||||
user: User;
|
||||
user: PublicUser;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
20
packages/database/prisma/json/User.ts
Normal file
20
packages/database/prisma/json/User.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { User } from "../../generated/client";
|
||||
|
||||
export interface PublicUser {
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
publicId: string;
|
||||
badges: string[];
|
||||
}
|
||||
|
||||
export const getPublicUser = (user: User): PublicUser => {
|
||||
return {
|
||||
firstname: user.firstname,
|
||||
lastname: user.lastname
|
||||
.split(" ")
|
||||
.map((part) => `${part[0]}.`)
|
||||
.join(" "), // Only take the first part of the name
|
||||
publicId: user.publicId,
|
||||
badges: user.badges,
|
||||
};
|
||||
};
|
||||
@@ -1 +1,3 @@
|
||||
export type { ParticipantLog } from "./ParticipantLog";
|
||||
export * from "./ParticipantLog";
|
||||
export * from "./MissionVehicleLog";
|
||||
export * from "./User";
|
||||
|
||||
Reference in New Issue
Block a user