Skip to content

How to add a special keyword to a model's prototype remote method #2497

@JoeShi

Description

@JoeShi

I have a API POST /calendars/:calendarId/events to create an event belongs to that calendar.

However, I'd have a get the calendarId before send the request. So I want to specify a special word to present the default calendar.

For example, I wish I can send POST /calendars/primary/events. Once the keyword primary being specified, it will add to the default calendar without knowing the primary calendar id.

I have tried to use beforeRemote. However, it never get invoked, instead, it gives me 404 error.

Calendar.beforeRemote('prototype.__create__events')

I have event tries Calendar.afterRemoteError('prototype.*), also this function never get invoked.

Metadata

Metadata

Assignees

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