How to use the @cardstack/hub/bootstrap-schema.concat function in @cardstack/hub

To help you get started, we’ve selected a few @cardstack/hub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cardstack / cardstack / tests / stub-searcher / searcher.js View on Github external
async get(session, type, id, next) {
    if (bootstrapSchema.concat(systemModels).find(m => m.type === type && m.id === id)) {
      return await next();
    }

    if (this.params.injectFirst) {
      return { data: this.makeModel(type, id, this.params.injectFirst), meta: this.makeMeta(type, id) };
    }

    let result = await next();
    if (result) {
      return result;
    }
    if (this.params.injectSecond) {
      return { data: this.makeModel(type, id, this.params.injectSecond), meta: this.makeMeta(type, id) };
    }
  }

@cardstack/hub

Stock API server for the Cardstack tech stack.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages