mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
refactoring
This commit is contained in:
19
shared_global/schema/project/ProjectLinkSchema.ts
Normal file
19
shared_global/schema/project/ProjectLinkSchema.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { model, Schema, Types } from 'mongoose';
|
||||
import { TPermission } from '../TeamMemberSchema';
|
||||
|
||||
export type TProjectLink = {
|
||||
_id: Schema.Types.ObjectId,
|
||||
project_id: Schema.Types.ObjectId,
|
||||
link_id: string,
|
||||
password: string,
|
||||
permission: TPermission
|
||||
}
|
||||
|
||||
const ProjectLinkSchema = new Schema<TProjectLink>({
|
||||
project_id: { type: Types.ObjectId, index: true, unique: true },
|
||||
link_id: { type: String, required: true },
|
||||
password: { type: String },
|
||||
permission: { type: Schema.Types.Mixed },
|
||||
});
|
||||
|
||||
export const ProjectLinkModel = model<TProjectLink>('project_links', ProjectLinkSchema);
|
||||
Reference in New Issue
Block a user