Specification
Requests

Requests

Requests detail how Interweave should communicate with an API. See the Request for implementation details.

const config = {
  key: ...,
  fields: ...,
  access: ...,
  requests: {
    // Will render a table of data if present
    get: {
      uri: "https://example.com/genres",
      http_method: "GET",
      data_path: "results.genres"
    },
    // Will render a form to create new entries
    create: {
      uri: "https://example.com/genres",
      http_method: "POST"
    },
    // Will render an update button
    update: {
      uri: "https://example.com/genres/<<row.id>>",
      http_method: "PATCH"
    },
    // Will render a delete button
    delete: {
      uri: "https://example.com/genres/<<row.id>>",
      http_method: "DELETE"
    }
  }
};

get

TypeRequiredDefault
RequestNoundefined

If present, will populate a table of records with the data returned from this. If omitted, the table will not render.

create

TypeRequiredDefault
RequestNoundefined

If present, will generate a form of fields created based on the schema.

update

TypeRequiredDefault
RequestNoundefined

If present, will enable selectable fields on the table and generate a form of fields created based on the schema that will enable updates.

delete

TypeRequiredDefault
RequestNoundefined

If present, table fields will become selectable and a delete button will appear.