refactor: rewrite /apps/:id to /app-store/:id
This commit is contained in:
parent
90d379cbd9
commit
91c857c810
4 changed files with 10 additions and 20 deletions
|
@ -23,6 +23,14 @@ const nextConfig = {
|
|||
NODE_ENV: process.env.NODE_ENV,
|
||||
REDIS_HOST: process.env.REDIS_HOST,
|
||||
},
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: '/apps/:id',
|
||||
destination: '/app-store/:id',
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
|
|
@ -34,6 +34,7 @@ export const handlers = [
|
|||
id: faker.number.int(),
|
||||
username: faker.internet.userName(),
|
||||
locale: 'en',
|
||||
operator: true,
|
||||
},
|
||||
}),
|
||||
// App
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import merge from 'lodash.merge';
|
||||
import { getAuthedPageProps, getMessagesPageProps } from '@/utils/page-helpers';
|
||||
import { GetServerSideProps } from 'next';
|
||||
|
||||
export { AppDetailsPage as default } from '../../client/modules/Apps/pages/AppDetailsPage';
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const authedProps = await getAuthedPageProps(ctx);
|
||||
const messagesProps = await getMessagesPageProps(ctx);
|
||||
|
||||
const { id } = ctx.query;
|
||||
const appId = String(id);
|
||||
|
||||
return merge(authedProps, messagesProps, {
|
||||
props: {
|
||||
appId,
|
||||
},
|
||||
});
|
||||
};
|
|
@ -33,7 +33,7 @@ export class AuthQueries {
|
|||
* @param {number} id - The id of the user to return
|
||||
*/
|
||||
public async getUserDtoById(id: number) {
|
||||
return this.db.query.userTable.findFirst({ where: eq(userTable.id, Number(id)), columns: { id: true, username: true, totpEnabled: true, locale: true } });
|
||||
return this.db.query.userTable.findFirst({ where: eq(userTable.id, Number(id)), columns: { id: true, username: true, totpEnabled: true, locale: true, operator: true } });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue