open-nomad/ui/app/utils/notify-conflict.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
380 B
JavaScript
Raw Normal View History

// @ts-check
// Catches errors with conflicts (409)
// and allow the route to handle them.
import { set } from '@ember/object';
import codesForError from './codes-for-error';
export default function notifyConflict(parent) {
return (error) => {
if (codesForError(error).includes('409')) {
set(parent, 'hasConflict', true);
} else {
return error;
}
};
}