[id].js 1.49 KB
import { Layout } from "antd";
import React from "react";
import Sidebar from "../../../components/layout/VendorDashboardSidebar";
import ActivityDetails from "../../../components/vendor/ActivityDetails";
import ActivityListingRBAC from "../../../components/vendor/ActivityListingRBAC";
import UpdateActivity from "../../../components/vendor/UpdateActivity";
import { getActivitiesByVendor, getActivityById } from "../../../redux/actions/activityAction";
import { getAllCategories, getAllSubCategories } from "../../../redux/actions/categoriesAction";
import { loadUser } from "../../../redux/actions/userActions";
import { wrapper } from "../../../redux/store";

const EditActivityDetail = () => {
  return (
    <Layout>
      <div className="sidebarContainer">
        <Sidebar />
        <div className="content">
          {/* <ActivityListingRBAC /> */}
          <ActivityDetails isUpdate={true} />
          {/* <UpdateActivity /> */}
        </div>
      </div>
    </Layout>
  );
};

export default EditActivityDetail;

/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
  // Get the menu data.
  // await store.dispatch(getActivitiesByVendor())
  await store.dispatch(loadUser());
  await store.dispatch(getAllCategories());
  await store.dispatch(getAllSubCategories());
  await store.dispatch(getActivityById(query.id));

  // get the locations data.
  // await store.dispatch(getVendorDetails())

  return {
    props: {}
  };
});