initial commit - code moved to separate repo
This commit is contained in:
46
pages/cart/reports/experience.tsx
Normal file
46
pages/cart/reports/experience.tsx
Normal file
@ -0,0 +1,46 @@
|
||||
//next.js page to show all locatons in the database with a link to the location page
|
||||
// import axios from "axios";
|
||||
import { Location, UserRole } from "@prisma/client";
|
||||
import Layout from "../../../components/layout";
|
||||
import ExperienceForm from "../../../components/reports/ExperienceForm";
|
||||
import axiosInstance from '../../../src/axiosSecure';
|
||||
import ProtectedRoute from '../../../components/protectedRoute';
|
||||
|
||||
function NewPage(loc: Location) {
|
||||
return (
|
||||
<Layout>
|
||||
<ProtectedRoute allowedRoles={[UserRole.POWERUSER, UserRole.ADMIN, UserRole.USER, UserRole.EXTERNAL]}>
|
||||
<div className="h-5/6 grid place-items-center">
|
||||
<ExperienceForm />
|
||||
</div></ProtectedRoute>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default NewPage;
|
||||
|
||||
//------------------pages\cart\locations\edit\[id].tsx------------------
|
||||
|
||||
export const getServerSideProps = async (context) => {
|
||||
return {
|
||||
props: {}
|
||||
};
|
||||
//if query is undefined, then it is a new location
|
||||
// if (context.query.id === undefined) {
|
||||
// return {
|
||||
// props: {}
|
||||
// };
|
||||
// }
|
||||
// const { data: loc } = await axiosInstance.get(
|
||||
// `${process.env.NEXTAUTH_URL}api/data/locations/` + context.params.id
|
||||
// );
|
||||
|
||||
// console.log(location) //this is the location object
|
||||
// context.res.setHeader("Cache-Control", "s-maxage=1, stale-while-revalidate");
|
||||
// return {
|
||||
// props: {
|
||||
// location: loc,
|
||||
|
||||
// },
|
||||
// };
|
||||
};
|
Reference in New Issue
Block a user