I usually use this generic function to delete a key from an object, but I'm open to better solutions if anyone has one:
const removeKeyFromObject = <T extends {}, K extends keyof T>(data: T, key: K) => {
const updatedData: any = { ...data };
delete updatedData[key];
return updatedData as Omit<T, K>;
}