diff --git a/src/back/app.ts b/src/back/app.ts index 13e17aa..796478d 100644 --- a/src/back/app.ts +++ b/src/back/app.ts @@ -1,6 +1,7 @@ import _locreq from "locreq"; import { resolve } from "path"; -import { App, Collection, FieldTypes, Policies } from "sealious"; +import { App } from "sealious"; +import tasks from "./collections/tasks"; const locreq = _locreq(__dirname); export default class TheApp extends App { @@ -32,12 +33,6 @@ export default class TheApp extends App { }; collections = { ...App.BaseCollections, - tasks: new (class extends Collection { - fields = { - title: new FieldTypes.Text(), - done: new FieldTypes.Boolean(), - }; - defaultPolicy = new Policies.Public(); - })(), + tasks, }; } diff --git a/src/back/collections/tasks.ts b/src/back/collections/tasks.ts new file mode 100644 index 0000000..86ce186 --- /dev/null +++ b/src/back/collections/tasks.ts @@ -0,0 +1,11 @@ +import { Collection, FieldTypes, Policies } from "sealious"; + +const tasks = new (class extends Collection { + fields = { + title: new FieldTypes.Text(), + done: new FieldTypes.Boolean(), + }; + defaultPolicy = new Policies.Public(); +})(); + +export default tasks;