mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-25 07:47:55 +01:00
24 lines
549 B
JavaScript
Vendored
24 lines
549 B
JavaScript
Vendored
import {Model as BaseModel, PluralResponse} from 'coloquent';
|
|
import {snakeCase} from 'lodash-es';
|
|
|
|
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));
|
|
}
|
|
}
|