feat: Add and refactor MIME type management
Some checks failed
CI Pipeline / japa-tests (push) Failing after 47s

- Added BaseModel with fillable attributes and mergeFillableAttributes method
- Refactored MimeType model to extend BaseModel
- Implemented destroy method in MimetypeController for deleting MIME types
- Updated Create.vue component with refactoring and improved type safety
- Fixed issues with ref usage in Create.vue
- Updated routes to include new and refactored endpoints
This commit is contained in:
Kaimbacher 2025-01-12 15:47:25 +01:00
parent d1480b1240
commit 537c6fd81a
10 changed files with 321 additions and 449 deletions

View file

@ -2,10 +2,10 @@ import { ApplicationService } from '@adonisjs/core/types';
// import { Database, DatabaseQueryBuilder } from '@adonisjs/lucid/database';
import { ModelQueryBuilder } from '@adonisjs/lucid/orm';
// import db from '@adonisjs/lucid/services/db';
import { LucidModel, LucidRow } from '@adonisjs/lucid/types/model';
// import { LucidModel, LucidRow } from '@adonisjs/lucid/types/model';
import { ChainableContract, ExcutableQueryBuilderContract } from '@adonisjs/lucid/types/querybuilder';
import { ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
// import { ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
/*
|--------------------------------------------------------------------------
| Provider
@ -37,16 +37,23 @@ declare module '@adonisjs/lucid/types/model' {
// selectId(primaryKey?: string): Promise<number | undefined>;
// selectIdOrFail(primaryKey?: string): Promise<number>;
// pluck(valueColumn: string, id?: string): Promise<{ [key: string]: any }>;
pluck<T extends LucidModel>(valueColumn: string, id?: string): Promise<{ [key: string]: any }>;
pluck(valueColumn: string, id?: string): Promise<{ [key: string]: any }>;
}
export interface LucidRow {
[key: string]: any;
}
}
declare module '@adonisjs/lucid/orm' {
class ModelQueryBuilder extends Chainable implements ModelQueryBuilderContract<LucidModel, LucidRow> {
public pluck(valueColumn: string, id?: string): Promise<{ [key: string]: any }>;
interface ModelQueryBuilder {
pluck(valueColumn: string, id?: string): Promise<{ [key: string]: any }>;
}
// class ModelQueryBuilder implements ModelQueryBuilderContract<LucidModel, LucidRow> {
// public pluck(valueColumn: string, id?: string): Promise<{ [key: string]: any }>;
// }
}