mirror of
https://github.com/meienberger/runtipi.git
synced 2024-09-11 12:15:48 +03:00
refactor: rewrite /apps/:id to /app-store/:id
This commit is contained in:
parent
b5945f4fcd
commit
bd8ce501ec
@ -23,6 +23,14 @@ const nextConfig = {
|
|||||||
NODE_ENV: process.env.NODE_ENV,
|
NODE_ENV: process.env.NODE_ENV,
|
||||||
REDIS_HOST: process.env.REDIS_HOST,
|
REDIS_HOST: process.env.REDIS_HOST,
|
||||||
},
|
},
|
||||||
|
async rewrites() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: '/apps/:id',
|
||||||
|
destination: '/app-store/:id',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
@ -34,6 +34,7 @@ export const handlers = [
|
|||||||
id: faker.number.int(),
|
id: faker.number.int(),
|
||||||
username: faker.internet.userName(),
|
username: faker.internet.userName(),
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
|
operator: true,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
// App
|
// 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
|
* @param {number} id - The id of the user to return
|
||||||
*/
|
*/
|
||||||
public async getUserDtoById(id: number) {
|
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…
Reference in New Issue
Block a user