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

The request option "include" does not work in Parse.User.me() #1657

Open
4 tasks done
frouo opened this issue Jan 19, 2023 · 1 comment
Open
4 tasks done

The request option "include" does not work in Parse.User.me() #1657

frouo opened this issue Jan 19, 2023 · 1 comment
Labels
type:feature New feature or improvement of existing feature

Comments

@frouo
Copy link

frouo commented Jan 19, 2023

New Issue Checklist

Issue Description

await Parse.User.me(sessionToken, { include: "books" }) does not work.

The "include" key is actually ignored, books remains unfetched.

Steps to reproduce

Create a Parse.User with a column of type Pointer array, let's call it "books", add books.

Call const me = await Parse.User.me(sessionToken, { include: "books" })

Actual Outcome

me.get("books") returns an array of unfetched Book.

Expected Outcome

Would expect that book data is available.

Environment

Server

  • Parse Server version: 5.4.0
  • Operating system: macOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): mongodb
  • Database version: 5.0.13
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • Parse JS SDK version: 3.4.4

Fix idea:

static me(sessionToken: string, options?: RequestOptions = {}) {

  static me(sessionToken: string, options?: RequestOptions = {}) {
    const controller = CoreManager.getUserController();
    const meOptions: RequestOptions = {
      sessionToken: sessionToken,
    };
    if (options.useMasterKey) {
      meOptions.useMasterKey = options.useMasterKey;
    }
// FIX
    if (options.include) {
      meOptions.include = options.include;
    }
// end FIX
    const user = new this();
    return controller.me(user, meOptions);
  }
@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants