mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
- Created EntityTable component for displaying test entities with expandable rows for releases. - Implemented ReleaseTable component to manage and display test releases with actions for editing and deleting. - Added ReleaseModal component for creating and editing releases - Introduced types for TestEntity, TestRelease, and related evaluations - Enhanced general settings page to include TMDB API configuration with connection testing functionality. - Added TMDBSettings component for managing TMDB API access token with reset and test connection features.
41 lines
886 B
TypeScript
41 lines
886 B
TypeScript
/**
|
|
* Delete test release operation
|
|
*/
|
|
|
|
import type { PCDCache } from '../../cache.ts';
|
|
import { writeOperation, type OperationLayer } from '../../writer.ts';
|
|
|
|
export interface DeleteTestReleaseOptions {
|
|
databaseId: number;
|
|
cache: PCDCache;
|
|
layer: OperationLayer;
|
|
releaseId: number;
|
|
}
|
|
|
|
/**
|
|
* Delete a test release by writing an operation to the specified layer
|
|
*/
|
|
export async function deleteRelease(options: DeleteTestReleaseOptions) {
|
|
const { databaseId, cache, layer, releaseId } = options;
|
|
const db = cache.kb;
|
|
|
|
const deleteQuery = db
|
|
.deleteFrom('test_releases')
|
|
.where('id', '=', releaseId)
|
|
.compile();
|
|
|
|
const result = await writeOperation({
|
|
databaseId,
|
|
layer,
|
|
description: `delete-test-release-${releaseId}`,
|
|
queries: [deleteQuery],
|
|
metadata: {
|
|
operation: 'delete',
|
|
entity: 'test_release',
|
|
name: `id:${releaseId}`
|
|
}
|
|
});
|
|
|
|
return result;
|
|
}
|