change protection for dropFields

This commit is contained in:
Hayden 2022-10-09 10:45:38 -05:00
parent 0120e197ca
commit 0c57a34325

View file

@ -43,7 +43,7 @@ export class BaseAPI {
* are present. This is useful for when you want to send a subset of fields to * are present. This is useful for when you want to send a subset of fields to
* the server like when performing an update. * the server like when performing an update.
*/ */
dropFields<T>(obj: T, keys: Array<keyof T> = []): T { protected dropFields<T>(obj: T, keys: Array<keyof T> = []): T {
const result = { ...obj }; const result = { ...obj };
[...keys, "createdAt", "updatedAt"].forEach(key => { [...keys, "createdAt", "updatedAt"].forEach(key => {
// @ts-ignore - we are checking for the key above // @ts-ignore - we are checking for the key above