Added library list UI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import schema from '/imports/api/schema.js';
|
||||
import SharingSchema from '/imports/api/sharing/SharingSchema.js';
|
||||
import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js';
|
||||
|
||||
/**
|
||||
* Libraries are trees of library nodes where each node represents a character
|
||||
@@ -23,4 +24,17 @@ LibrarySchema.extend(SharingSchema);
|
||||
Libraries.attachSchema(LibrarySchema);
|
||||
|
||||
export default Libraries;
|
||||
export { LibrarySchema };
|
||||
|
||||
const insertLibrary = new ValidatedMethod({
|
||||
name: 'Libraries.methods.insert',
|
||||
mixins: [
|
||||
simpleSchemaMixin,
|
||||
],
|
||||
schema: LibrarySchema.omit('owner'),
|
||||
run(library) {
|
||||
library.owner = this.userId;
|
||||
return Libraries.insert(library);
|
||||
},
|
||||
});
|
||||
|
||||
export { LibrarySchema, insertLibrary };
|
||||
|
||||
Reference in New Issue
Block a user