File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
import { Model , model } from "mongoose"
2
- import { Poll , PollSchema } from './poll.schema' ;
2
+ import { PollSchema , pollSchema } from './poll.schema' ;
3
3
4
- export default model < Poll , Model < Poll > > ( "Poll" , PollSchema ) ;
4
+ export default model < PollSchema , Model < PollSchema > > ( "Poll" , pollSchema ) ;
5
5
Original file line number Diff line number Diff line change 1
1
import { Document , Schema , Types } from 'mongoose' ;
2
- import { User } from '../users/user.schema' ;
3
2
4
3
interface ImageData {
5
4
url : string ;
6
5
votes : number ;
7
6
}
8
7
9
- export interface Poll extends Document {
8
+ export interface PollSchema extends Document {
10
9
authorId : string ;
11
10
contents : {
12
11
left : ImageData ;
@@ -20,7 +19,7 @@ const imageDataSchema = {
20
19
votes : Number
21
20
}
22
21
23
- export const PollSchema = new Schema ( {
22
+ export const pollSchema = new Schema ( {
24
23
contents : {
25
24
left : imageDataSchema ,
26
25
right : imageDataSchema
Original file line number Diff line number Diff line change 1
1
import { Model , model } from "mongoose"
2
- import { User , UserSchema } from './user.schema' ;
2
+ import { UserSchema , userSchema } from './user.schema' ;
3
3
4
- export default model < User , Model < User > > ( "User" , UserSchema ) ;
4
+ export default model < UserSchema , Model < UserSchema > > ( "User" , userSchema ) ;
5
5
Original file line number Diff line number Diff line change 1
1
import { Document , Schema } from "mongoose"
2
2
3
- export interface User extends Document {
3
+ export interface UserSchema extends Document {
4
4
name : string ;
5
5
avatarUrl ?: string ;
6
6
age ?: number ;
7
7
}
8
8
9
- export const UserSchema = new Schema ( {
9
+ export const userSchema = new Schema ( {
10
10
name : String ,
11
11
avatarUrl : {
12
12
type : String ,
You can’t perform that action at this time.
0 commit comments