1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-25 15:58:56 +01:00
2021-10-08 12:33:05 +02:00

24 lines
546 B
JavaScript
Vendored

import {Model as BaseModel, PluralResponse} from 'coloquent';
import {snakeCase} from 'lodash';
export default class Model extends BaseModel {
/**
* Just an alias to the get() method
*/
static all(): Promise<PluralResponse<InstanceType<Model>>> {
return this.get();
}
getAttribute(attributeName: string): any {
return super.getAttribute(attributeName);
}
getJsonApiBaseUrl(): string {
return '/api';
}
getJsonApiType(): string {
return (super.getJsonApiType() ?? snakeCase(this.constructor.name));
}
}