Move collections to separate directory
This commit is contained in:
parent
9e3fbd5d08
commit
93d6546ce9
@ -1,6 +1,7 @@
|
|||||||
import _locreq from "locreq";
|
import _locreq from "locreq";
|
||||||
import { resolve } from "path";
|
import { resolve } from "path";
|
||||||
import { App, Collection, FieldTypes, Policies } from "sealious";
|
import { App } from "sealious";
|
||||||
|
import tasks from "./collections/tasks";
|
||||||
const locreq = _locreq(__dirname);
|
const locreq = _locreq(__dirname);
|
||||||
|
|
||||||
export default class TheApp extends App {
|
export default class TheApp extends App {
|
||||||
@ -32,12 +33,6 @@ export default class TheApp extends App {
|
|||||||
};
|
};
|
||||||
collections = {
|
collections = {
|
||||||
...App.BaseCollections,
|
...App.BaseCollections,
|
||||||
tasks: new (class extends Collection {
|
tasks,
|
||||||
fields = {
|
|
||||||
title: new FieldTypes.Text(),
|
|
||||||
done: new FieldTypes.Boolean(),
|
|
||||||
};
|
|
||||||
defaultPolicy = new Policies.Public();
|
|
||||||
})(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
11
src/back/collections/tasks.ts
Normal file
11
src/back/collections/tasks.ts
Normal file
@ -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;
|
Loading…
x
Reference in New Issue
Block a user