Skip to content

Instantly share code, notes, and snippets.

@prinzdezibel
Last active January 12, 2018 14:32
Show Gist options
  • Save prinzdezibel/dd9e593044fb9a0c3d32b173aa4684ae to your computer and use it in GitHub Desktop.
Save prinzdezibel/dd9e593044fb9a0c3d32b173aa4684ae to your computer and use it in GitHub Desktop.
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Product } from "/lib/collections/schemas/index";
import { Products } from "/lib/collections/index";
import { getSchemas, registerSchema } from "@reactioncommerce/reaction-collections";
const ExtendedSchema = new SimpleSchema([
Product,
{
featuredProductLabel: {
optional: true,
type: String
}
}
]);
Products.attachSchema(ExtendedSchema, { replace: true, selector: { type: "simple" } });
registerSchema("Product", ExtendedSchema);
const Schemas = getSchemas();
const ExtendedFilters = new SimpleSchema([
Schemas.filters,
{
featuredProductLabel: {
optional: true,
type: String
}
}
]);
registerSchema("filters", ExtendedFilters);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment