refactor: rewrite /apps/:id to /app-store/:id

This commit is contained in:
Nicolas Meienberger 2023-09-28 10:08:19 +02:00 committed by Nicolas Meienberger
parent b5945f4fcd
commit bd8ce501ec
4 changed files with 10 additions and 20 deletions

View File

@ -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;

View File

@ -34,6 +34,7 @@ export const handlers = [
id: faker.number.int(),
username: faker.internet.userName(),
locale: 'en',
operator: true,
},
}),
// App

View File

@ -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,
},
});
};

View File

@ -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 } });
}
/**