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

fix: get all newsletter pagination #567

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controllers/OrgController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ export class OrgController {
async getAllInvite(req: Request, res: Response, next: NextFunction) {
try {
const page = parseInt(req.query.page as string, 10) || 1;
const pageSize = parseInt(req.query.pageSize as string, 10) || 10;
const pageSize = parseInt(req.query.limit as string, 10) || 10;

const { status_code, message, data, total } =
await this.orgService.getAllInvite(page, pageSize);
Expand Down
2 changes: 2 additions & 0 deletions src/services/newsLetterSubscription.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export class NewsLetterSubscriptionService
limit?: number;
}) {
try {
page = page ? page : 1;
limit = limit ? limit : 10;
const [newsletters, total] = await this.newsLetterSubscriber.findAndCount(
{
skip: (page - 1) * limit,
Expand Down
1 change: 0 additions & 1 deletion src/services/org.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ export class OrgService implements IOrgService {
permission.role = newRole;
return permission;
});

await this.permissionRepository.save(rolePermissions);
return newRole;
} catch (err) {
Expand Down
Loading