Files
Saadi Myftija 28b6be2491 feat: introduce run templates for reusing test run configs (#2253)
* Add new prisma model for task run templates

* Create run templates in a new service

* Add modal to create run templates in the test page

* Show templates list and apply values when selected

* Hide template creation time in the dropdown list, only show date

* Enable deleting run templates

* Show success toast on template creation

* Validate template label length

* Improve the template creation success indicator

* Use formAction consistently to differentiate submissions

* Type formAction for better editor support

* Prettify run template payload and metadata

* Add triggerSource, concurrencyKey and ttl to run templates
2025-07-09 19:09:25 +02:00

20 lines
592 B
TypeScript

import { BaseService } from "./baseService.server";
import { type AuthenticatedEnvironment } from "~/services/apiAuth.server";
export class DeleteTaskRunTemplateService extends BaseService {
public async call(environment: AuthenticatedEnvironment, templateId: string) {
try {
await this._prisma.taskRunTemplate.delete({
where: {
id: templateId,
projectId: environment.projectId,
},
});
} catch (e) {
throw new Error(
`Error deleting template: ${e instanceof Error ? e.message : JSON.stringify(e)}`
);
}
}
}