mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
refactoring dashboard
This commit is contained in:
16
shared_global/schema/UserSettings.ts
Normal file
16
shared_global/schema/UserSettings.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { model, Schema, Types } from 'mongoose';
|
||||
|
||||
export type TUserSettings = {
|
||||
user_id: Schema.Types.ObjectId,
|
||||
max_projects: number,
|
||||
active_project_id: Schema.Types.ObjectId
|
||||
}
|
||||
|
||||
const UserSettingsSchema = new Schema<TUserSettings>({
|
||||
user_id: { type: Types.ObjectId, unique: true, index: 1 },
|
||||
max_projects: { type: Number, default: 3 },
|
||||
active_project_id: Schema.Types.ObjectId,
|
||||
});
|
||||
|
||||
export const UserSettingsModel = model<TUserSettings>('user_settings', UserSettingsSchema);
|
||||
|
||||
Reference in New Issue
Block a user