open-nomad/ui/app/adapters/namespace.js
Buck Doyle cd11cd290c Add manually-converted classes
I don’t know why the codemod ignored these files 🧐
2020-06-15 10:14:26 -05:00

14 lines
405 B
JavaScript

import ApplicationAdapter from './application';
import codesForError from '../utils/codes-for-error';
export default class NamespaceAdapter extends ApplicationAdapter {
findRecord(store, modelClass, id) {
return super.findRecord(...arguments).catch(error => {
const errorCodes = codesForError(error);
if (errorCodes.includes('501')) {
return { Name: id };
}
});
}
}