Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The public folder and exporting schemas without collections. #154

Open
nayelo opened this issue Mar 18, 2016 · 1 comment
Open

The public folder and exporting schemas without collections. #154

nayelo opened this issue Mar 18, 2016 · 1 comment

Comments

@nayelo
Copy link
Contributor

nayelo commented Mar 18, 2016

How should we import/export collections which have schemas attached and sub-schemas that are used over multiple collections? I have tried to retain a convention of exporting from a lib/collections.js file, but my sub-schemas (meta and admin) are not being imported as they are not attached to a collection. If I define the Meta sub-schema in the schemas/Constellations.js file the error disappears, but that is not a real solution as the sub-schemas are used across many collections.

Throwing Meta is required from (server/configs/initial_adds.js:18:22) in the attached files.

I also have svg files in the public folder that I need to access in the client components. Is there a Mantra standard for either case?

https://github.com/GetGee/G/tree/master/lib
https://github.com/GetGee/G/tree/master/server

@nayelo nayelo changed the title Exporting schemas and collections The public folder and exporting schemas without collections. Mar 19, 2016
@martinwh99
Copy link

i'm also using SimpleSchema with sub-schemas in Mantra. My collections.js looks like this and it works:

import Employees from './schemas/Employee';
import Tenants from './schemas/organisations/Tenants';
import Organisations from './schemas/organisations/Organisations';
import BaseRoles from './schemas/authorizations/BaseRoles';
import Groups from './schemas/authorizations/Groups';

export {

Employees,
Tenants,
Organisations,
BaseRoles,
Groups

}

in containers folder you can than use

....
const {LocalState, Meteor, Collections} = context();
...
const employee = Collections.Employees.findOne(selector);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants