From 93d6546ce972ef5267f3613f9504b68f3691792c Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sun, 7 Feb 2021 14:46:51 +0100 Subject: [PATCH] Move collections to separate directory --- src/back/app.ts | 11 +++-------- src/back/collections/tasks.ts | 11 +++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 src/back/collections/tasks.ts 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;