format codebase with prettier
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
import mongoose, { Schema, Document, Model } from 'mongoose';
|
||||
import { CalendarEvent } from '@caldav/shared';
|
||||
import { IdVirtual } from './types';
|
||||
import mongoose, { Schema, Document, Model } from "mongoose";
|
||||
import { CalendarEvent } from "@caldav/shared";
|
||||
import { IdVirtual } from "./types";
|
||||
|
||||
export interface EventDocument extends Omit<CalendarEvent, 'id'>, Document {
|
||||
export interface EventDocument extends Omit<CalendarEvent, "id">, Document {
|
||||
toJSON(): CalendarEvent;
|
||||
}
|
||||
|
||||
const EventSchema = new Schema<EventDocument, Model<EventDocument, {}, {}, IdVirtual>, {}, {}, IdVirtual>(
|
||||
const EventSchema = new Schema<
|
||||
EventDocument,
|
||||
Model<EventDocument, {}, {}, IdVirtual>,
|
||||
{},
|
||||
{},
|
||||
IdVirtual
|
||||
>(
|
||||
{
|
||||
userId: {
|
||||
type: String,
|
||||
@@ -58,9 +64,9 @@ const EventSchema = new Schema<EventDocument, Model<EventDocument, {}, {}, IdVir
|
||||
return ret;
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
EventSchema.index({ userId: 1, startTime: 1, endTime: 1 });
|
||||
|
||||
export const EventModel = mongoose.model<EventDocument>('Event', EventSchema);
|
||||
export const EventModel = mongoose.model<EventDocument>("Event", EventSchema);
|
||||
|
||||
Reference in New Issue
Block a user