forked from TeamCodeStream/codestream-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemark.js
More file actions
26 lines (20 loc) · 718 Bytes
/
Copy pathcodemark.js
File metadata and controls
26 lines (20 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// provides the Codemark model for handling codemarks
'use strict';
const CodeStreamModel = require(process.env.CSSVC_BACKEND_ROOT + '/api_server/lib/models/codestream_model');
const CodemarkAttributes = require('./codemark_attributes');
const CodemarkValidator = require('./codemark_validator');
class Codemark extends CodeStreamModel {
getValidator () {
return new CodemarkValidator(CodemarkAttributes);
}
// called right before we save...
async preSave (options) {
// ensure all native IDs are lowercase
this.lowerCase('teamId');
this.lowerCaseNativeId('streamId');
this.lowerCaseNativeId('postId');
this.lowerCase('markerIds');
await super.preSave(options);
}
}
module.exports = Codemark;