Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Metadata methods does not work as intended #2

Open
kerwanp opened this issue Oct 7, 2024 · 0 comments
Open

Metadata methods does not work as intended #2

kerwanp opened this issue Oct 7, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@kerwanp
Copy link
Contributor

kerwanp commented Oct 7, 2024

Description

The stripeName, stripeEmail, etc, methods does not work as intended. They result in undefined even if the model actually have the properties.

It seems this is because the properties does not actually live on the object itself but under $attributes.

Proposal

Instead of looking at the instance itself ('name' in this this.name : undefined) we should use the $getAttribute method given by Lucid.

    stripeName(): string | undefined {
      return this.$getAttribute('name')
    }
@kerwanp kerwanp added bug Something isn't working good first issue Good for newcomers labels Oct 7, 2024
@kerwanp kerwanp added this to the v1 milestone Oct 7, 2024
@kerwanp kerwanp mentioned this issue Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant