Skip to content

Created & updated dates are not generated/updated when adding/updating API #1652

@jykae

Description

@jykae

Should be probably done "before" DB insert in autoform.js:

AutoForm.hooks({
  "addApiForm": {
    before: {
      insert (api) {
        // Get current user ID
        const userId = Meteor.userId();

        // Add current user as API manager
        api.managerIds = [userId];

        // Submit the form
        return api;
      }
    },
    onSuccess (formType, apiId) {
      // Redirect to newly added API
      Router.go("viewApi", { _id: apiId });
    }
  }
});

Catalogue shows "Added a few seconds ago" for all APIs that don't have that generated.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions