-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable editors in timeline for multi user timeline (#931)
* feat: multi-user timeline * Update user-experience.service.ts * Update experience.controller.ts * format fix
- Loading branch information
Showing
10 changed files
with
126 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {Entity, model, property} from '@loopback/repository'; | ||
|
||
@model({ | ||
settings: { | ||
strictObjectIDCoercion: true, | ||
mongodb: { | ||
collection: 'ExperienceEditors', | ||
}, | ||
indexes: { | ||
uniqueUserExperienceIndex: { | ||
keys: { | ||
userId: 1, | ||
experienceId: 1, | ||
}, | ||
options: { | ||
unique: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
export class ExperienceEditor extends Entity { | ||
@property({ | ||
type: 'string', | ||
id: true, | ||
generated: true, | ||
mongodb: { | ||
dataType: 'ObjectId', | ||
}, | ||
}) | ||
id?: string; | ||
|
||
@property({ | ||
type: 'string', | ||
required: false, | ||
}) | ||
experienceId: string; | ||
|
||
@property({ | ||
type: 'string', | ||
required: false, | ||
}) | ||
userId: string; | ||
|
||
constructor(data?: Partial<ExperienceEditor>) { | ||
super(data); | ||
} | ||
} | ||
|
||
export interface ExperienceEditorRelations { | ||
// describe navigational properties here | ||
} | ||
|
||
export type ExperienceEditorWithRelations = ExperienceEditor & | ||
ExperienceEditorRelations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {bind, BindingScope, inject} from '@loopback/core'; | ||
import {DefaultCrudRepository} from '@loopback/repository'; | ||
import {MongoDataSource} from '../datasources'; | ||
import {ExperienceEditor, ExperienceEditorRelations} from '../models'; | ||
|
||
@bind({scope: BindingScope.SINGLETON}) | ||
export class ExperienceEditorRepository extends DefaultCrudRepository< | ||
ExperienceEditor, | ||
typeof ExperienceEditor.prototype.id, | ||
ExperienceEditorRelations | ||
> { | ||
constructor(@inject('datasources.mongo') dataSource: MongoDataSource) { | ||
super(ExperienceEditor, dataSource); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters