Files
profilarr/src/lib/server/pcd/queries/entityTests/deleteRelease.ts
Sam Chau 74b38df686 feat: add entity and release management components
- 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.
2026-01-14 23:50:20 +10:30

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;
}