How to use the @nakedobjects/services.HttpStatusCode.UnprocessableEntity function in @nakedobjects/services

To help you get started, we’ve selected a few @nakedobjects/services 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 NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / contributed-action-parent-view-model.ts View on Github external
const rejectAsNeedSelection = (action: Ro.ActionRepresentation | Ro.InvokableActionMember): ErrorWrapper | null => {
                if (this.isLocallyContributed(action)) {
                    if (selected.length === 0) {
                        const em = new Ro.ErrorMap({}, 0, Msg.noItemsSelected);
                        const rp = new ErrorWrapper(ErrorCategory.HttpClientError, HttpStatusCode.UnprocessableEntity, em);
                        return rp;
                    }
                }
                return null;
            };