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

@latest release did not rebuild lib #75

Closed
jkalberer opened this issue Jan 17, 2023 · 2 comments
Closed

@latest release did not rebuild lib #75

jkalberer opened this issue Jan 17, 2023 · 2 comments

Comments

@jkalberer
Copy link
Contributor

I installed 0.10.0 (latest) and compared the Paginator.ts vs the Paginator.js in the lib folder.

It looks like the release didn't actually build the changes. I see:

buildCursorQuery(where, cursors) {
        const operator = this.getOperator();
        const params = {};
        this.paginationKeys.forEach((key) => {
            params[key] = cursors[key];
            where.andWhere(new typeorm_1.Brackets((qb) => {
                const paramsHolder = {
                    [`${key}_1`]: params[key],
                    [`${key}_2`]: params[key],
                };
                qb.where(`${this.alias}.${key} ${operator} :${key}_1`, paramsHolder);
                if (this.paginationUniqueKey !== key) {
                    qb.orWhere(`${this.alias}.${key} = :${key}_2`, paramsHolder);
                }
            }));
        });
    }

Which does not match the typescript file:

private buildCursorQuery(where: WhereExpressionBuilder, cursors: CursorParam): void {
   const operator = this.getOperator();
   const params: CursorParam = {};
   let query = '';
   this.paginationKeys.forEach((key) => {
     params[key] = cursors[key];
     where.orWhere(`${query}${this.alias}.${key} ${operator} :${key}`, params);
     query = `${query}${this.alias}.${key} = :${key} AND `;
   });
}
@stuartf123
Copy link

I think both implementations of this method are flawed:
#65

@benjamin658
Copy link
Owner

@jkalberer You are right, somehow it didn't rebuild before I published the package to the npm.

I have republished the v0.10.1 with the correct built lib, please upgrade your version and try again.

Thanks.

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

No branches or pull requests

3 participants