Skip to content

Commit

Permalink
Merge pull request #1449 from AletheiaFact/prepare-nextjs-upgrade
Browse files Browse the repository at this point in the history
Refactor the ViewService NextJS render interface in preparation for the lib upgrade
  • Loading branch information
thesocialdev authored Nov 12, 2024
2 parents d375901 + d199e6d commit 5359403
Show file tree
Hide file tree
Showing 41 changed files with 385 additions and 420 deletions.
12 changes: 4 additions & 8 deletions server/auth/name-space/name-space.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,10 @@ export class NameSpaceController {
const nameSpaces = await this.nameSpaceService.listAll();
const users = await this.usersService.findAll({});
const parsedUrl = parse(req.url, true);
await this.viewService
.getNextServer()
.render(
req,
res,
"/admin-namespaces",
Object.assign(parsedUrl.query, { nameSpaces, users })
);

const query = Object.assign(parsedUrl.query, { nameSpaces, users });

await this.viewService.render(req, res, "/admin-namespaces", query);
}

private async updateNameSpaceUsers(users, key) {
Expand Down
6 changes: 1 addition & 5 deletions server/auth/ory/ory.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ export default class OryController {
@Res() res: NextApiResponse
) {
const parsedUrl = parse(req.url, true);
await this.viewService.getNextServer().getRequestHandler()(
req,
res,
parsedUrl
);
await this.viewService.getRequestHandler()(req, res, parsedUrl);
}
}
18 changes: 8 additions & 10 deletions server/badge/badge.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,13 @@ export class BadgeController {
},
});
const parsedUrl = parse(req.url, true);
await this.viewService.getNextServer().render(
req,
res,
"/admin-badges",
Object.assign(parsedUrl.query, {
badges,
users,
nameSpace: req.params.namespace,
})
);

const query = Object.assign(parsedUrl.query, {
badges,
users,
nameSpace: req.params.namespace,
});

await this.viewService.render(req, res, "/admin-badges", query);
}
}
Loading

0 comments on commit 5359403

Please sign in to comment.