Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method inside the Job class is not callable #71

Closed
LeCoupa opened this issue Feb 9, 2021 · 4 comments · Fixed by #72
Closed

Method inside the Job class is not callable #71

LeCoupa opened this issue Feb 9, 2021 · 4 comments · Fixed by #72

Comments

@LeCoupa
Copy link
Contributor

LeCoupa commented Feb 9, 2021

The task below will trigger the following error when called.

TypeError: this.myMethod is not a function

export default class MyTask implements JobContract {
  public key = 'theTaskKey'

  public async handle(job) {
    this.myMethod()
  }

  public async myMethod() {}
}

Is there a way to call a method from the same class inside handle()?

@HigoRibeiro
Copy link
Contributor

Hi @LeCoupa !
Unfortunately, as it is being done today it is not possible.
But I will made a PR that fixes this.

@LeCoupa
Copy link
Contributor Author

LeCoupa commented Feb 11, 2021

Thank you 😊

@jpedroschmitz
Copy link
Contributor

Hey, I've just published 1.0.0-1 that should fix the issue.

Let me know if you have any problem @LeCoupa 💜

@LeCoupa
Copy link
Contributor Author

LeCoupa commented Feb 12, 2021

Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants