Skip to content

ID should be required for client service get method #3618

@DaddyWarbucks

Description

@DaddyWarbucks

The get() method for the base client service does not enforce that the ID is not defined.
See:

get(id: Id, params: Params = {}) {

The update() method enforces this as you would expect.
See:

_update(id: NullableId, data: D, params: Params = {}) {

Without enforcing that the get() method has an ID, it just returns a random record;

const user = await app.service('users').get();
// user is defined because it basically did a find();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions