mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(filters): store and update with no external filters (#1049)
* fix(filters): store and update * fix(filters): bad fmt var * fix(filters): store expect status * fix(filters): store expect status * fix(filters): external filter always rejected
This commit is contained in:
parent
0fa53b0b2e
commit
3e244fac10
14 changed files with 151 additions and 125 deletions
|
@ -226,7 +226,7 @@ const schema = z.object({
|
|||
name: z.string(),
|
||||
indexers: z.array(indexerSchema).min(1, { message: "Must select at least one indexer" }),
|
||||
actions: z.array(actionSchema),
|
||||
external: z.array(externalFilterSchema)
|
||||
external: z.array(externalFilterSchema),
|
||||
});
|
||||
|
||||
export function FilterDetails() {
|
||||
|
@ -398,14 +398,6 @@ export function FilterDetails() {
|
|||
indexers: filter.indexers || [],
|
||||
actions: filter.actions || [],
|
||||
external: filter.external || [],
|
||||
external_script_enabled: filter.external_script_enabled || false,
|
||||
external_script_cmd: filter.external_script_cmd || "",
|
||||
external_script_args: filter.external_script_args || "",
|
||||
external_script_expect_status: filter.external_script_expect_status || 0,
|
||||
external_webhook_enabled: filter.external_webhook_enabled || false,
|
||||
external_webhook_host: filter.external_webhook_host || "",
|
||||
external_webhook_data: filter.external_webhook_data ||"",
|
||||
external_webhook_expect_status: filter.external_webhook_expect_status || 0
|
||||
} as Filter}
|
||||
onSubmit={handleSubmit}
|
||||
enableReinitialize={true}
|
||||
|
|
|
@ -280,10 +280,9 @@ const TypeForm = ({external, idx}: TypeFormProps) => {
|
|||
</div>
|
||||
<div className="mt-6 grid grid-cols-12 gap-6">
|
||||
<NumberField
|
||||
name={`external.${idx}.script_expected_status`}
|
||||
name={`external.${idx}.exec_expect_status`}
|
||||
label="Expected exit status"
|
||||
placeholder="0"
|
||||
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -320,7 +319,7 @@ const TypeForm = ({external, idx}: TypeFormProps) => {
|
|||
/>
|
||||
|
||||
<NumberField
|
||||
name={`external.${idx}.webhook_expected_status`}
|
||||
name={`external.${idx}.webhook_expect_status`}
|
||||
label="Expected http status"
|
||||
placeholder="200"
|
||||
/>
|
||||
|
|
10
web/src/types/Filter.d.ts
vendored
10
web/src/types/Filter.d.ts
vendored
|
@ -71,14 +71,6 @@ interface Filter {
|
|||
actions: Action[];
|
||||
indexers: Indexer[];
|
||||
external: ExternalFilter[];
|
||||
external_script_enabled: boolean;
|
||||
external_script_cmd: string;
|
||||
external_script_args: string;
|
||||
external_script_expect_status: number;
|
||||
external_webhook_enabled: boolean;
|
||||
external_webhook_host: string;
|
||||
external_webhook_data: string;
|
||||
external_webhook_expect_status: number;
|
||||
}
|
||||
|
||||
interface Action {
|
||||
|
@ -130,10 +122,12 @@ interface ExternalFilter {
|
|||
enabled: boolean;
|
||||
exec_cmd?: string;
|
||||
exec_args?: string;
|
||||
exec_expect_status?: number;
|
||||
webhook_host?: string,
|
||||
webhook_type?: string;
|
||||
webhook_method?: WebhookMethod;
|
||||
webhook_data?: string,
|
||||
webhook_headers?: string;
|
||||
webhook_expect_status?: number;
|
||||
filter_id?: number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue