I am faced with a TypeScript interface challenge:
interface SupplierSettings {
id_supplier_settings?: number;
is_auto_order: boolean;
order_cron: string;
email: string;
get_next_run_date?: string;
dont_wait_for_mail_response: boolean;
}
In the second interface, I need to include fields from SupplierSettings
, and it should appear as follows:
interface AssignManufacturerToSupplier {
upsertSupplierSettings: {
// fields from SupplierSettings
id_supplier_settings?: number;
is_auto_order: boolean;
order_cron: string;
email: string;
get_next_run_date?: string;
dont_wait_for_mail_response: boolean;
// end of fields from SupplierSettings
suppliers: {
connect: number;
}
};
assignManufacturerToSupplier: {
id_product_supplier: string;
manufacturers: {
delete?: [number];
connect?: [number];
}
};
}
How can I achieve this?
I attempted the following solution:
interface AssignManufacturerToSupplier {
upsertSupplierSettings: {
SupplierSettings;
suppliers: {
connect: number;
}
};
assignManufacturerToSupplier: {
id_product_supplier: string;
manufacturers: {
delete?: [number];
connect?: [number];
}
};
}
Unfortunately, my attempted solution did not work as expected.