2019-05-01 18:09:29 +00:00
|
|
|
import RepositoryService from 'consul-ui/services/repository';
|
|
|
|
import statusFactory from 'consul-ui/utils/acls-status';
|
|
|
|
import isValidServerErrorFactory from 'consul-ui/utils/http/acl/is-valid-server-error';
|
|
|
|
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/role';
|
|
|
|
|
|
|
|
const isValidServerError = isValidServerErrorFactory();
|
|
|
|
const status = statusFactory(isValidServerError, Promise);
|
|
|
|
const MODEL_NAME = 'role';
|
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class RoleService extends RepositoryService {
|
|
|
|
getModelName() {
|
2019-05-01 18:09:29 +00:00
|
|
|
return MODEL_NAME;
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getPrimaryKey() {
|
2019-05-01 18:09:29 +00:00
|
|
|
return PRIMARY_KEY;
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getSlugKey() {
|
2019-05-01 18:09:29 +00:00
|
|
|
return SLUG_KEY;
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
status(obj) {
|
2019-05-01 18:09:29 +00:00
|
|
|
return status(obj);
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|