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

Parser MenuServiceItem JSON #772

Open
4 tasks done
ronnie-codes opened this issue Oct 4, 2024 · 0 comments
Open
4 tasks done

Parser MenuServiceItem JSON #772

ronnie-codes opened this issue Oct 4, 2024 · 0 comments
Labels
question Further information is requested

Comments

@ronnie-codes
Copy link
Contributor

Question

Hi I'm trying to pass a menu item back from the client to the server and execute the endpoint, but I'm not sure how to get the YTNode class from my json object. Is this possible?

Here I tried with the parser but the parser throws an error.

  public async updateHomeFeed(menuItem: HomeMenuItemDTO): Promise<any> {
      const node = Parser.parse(menuItem).item();
      const menuServiceItem = node.as(YTNodes.MenuServiceItem);
      const endpoint = menuServiceItem.endpoint;

      endpoint.payload = {
        feedbackTokens: [endpoint.payload.feedbackToken],
        isFeedbackTokenUnencrypted: false,
        shouldMerge: false
      };

      const response = await this.repository.call(endpoint, { parse: false });
      console.log(response);
      return response
  }

Other details

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
@ronnie-codes ronnie-codes added the question Further information is requested label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant