initial commit - code moved to separate repo
This commit is contained in:
25
pages/cart/cartevents/edit/[id].tsx
Normal file
25
pages/cart/cartevents/edit/[id].tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import NewPage from "../new";
|
||||
|
||||
import axiosServer from '../../../../src/axiosServer';
|
||||
export default NewPage;
|
||||
|
||||
export const getServerSideProps = async (context) => {
|
||||
console.log("edit page getServerSideProps");
|
||||
const axios = await axiosServer(context);
|
||||
const { id } = context.query;
|
||||
const { data } = await axios.get(`${process.env.NEXTAUTH_URL}/api/data/cartevents/` + id);
|
||||
const locations = await axios
|
||||
.get(`${process.env.NEXTAUTH_URL}/api/data/locations?select=id,name`)
|
||||
.then((res) => {
|
||||
console.log("locations: " + JSON.stringify(res.data));
|
||||
return res.data;
|
||||
});
|
||||
|
||||
return {
|
||||
props: {
|
||||
item: data,
|
||||
locations: locations,
|
||||
inline: false,
|
||||
},
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user