Skip to content

hasOwnProperty is not a function #89

Closed
@lucianobosco

Description

@lucianobosco

Since last update I'm getting hasOwnProperty is not a function
I used to create a payload with differences to be sent to my API through axios:

      const diffs = diff(originalResource.value, resource.value)
      const payload = {
        ...(diffs.hasOwnProperty('name') && { name: resource.value.name }),
        ...(diffs.hasOwnProperty('slug') && { slug: resource.value.slug }),
        ...(diffs.hasOwnProperty('visible') && { visible: resource.value.visible }),
        ...(diffs.hasOwnProperty('postCategory') && { post_category_id: resource.value.postCategory?.id || null }),
        ...(diffs.hasOwnProperty('parent') && { parent_id: resource.value.parent?.id || null })
      }

Did anything change in regards to returned response from method diff(). In that case, how can I get diff() properties changed in order to create a new payload object?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions