## Agenda We will try to cover most of these topics in today's sessions and the remaining in the next. * Build the Home Page * Map movies to theaters * Build the shows components * Build the seating arrangements * Book tickets * Make Payments * Deploy It is going to be a bit challenging, advanced, but very interesting session covering topics that are asked very frequently in interviews. So let's start. ## Build the Home Page Till now we have completed the login page, then the home page if you click on the name then it will take us to the admin page. as shown below. You have to take care of the admin rights, wwhich will have all the rights of adding movies and their related properties. Admin can manage the movies and can manage the theaters. Then we will talk about the shows that in which region which show is running, timeof that show. Add movies has already been done, where you can provide movie name, description, duration, etc. If you click on the Save button, it is not saved. Whenever, the save button clicked it calls the submit. So we have to implement the operation of saving the form data into the database when clicked on the save button. ![](https://d2beiqkhq929f0.cloudfront.net/public_assets/assets/000/051/351/original/upload_d571955d6145ed8751d953e02d03a702.png?1695975201) As route is already working, what shoukd be the second step. **Asking Question?** We should create an axios instance for the movies as well as we created for the users in the Apicalls so that we can do the add movies, delete movies etc. In the movies.js do the following as explained below: ```javascript import { axiosInstance } from "." export const AddMovie = async (payload) => { try{ const response = await axiosInstance.post('/api/movies/add-movie',payload); return response.data }catch(err){ return err.response } } ``` Heer the *payload* is the form data and the respective endpoint is `/api/movies/add-movie`. Now lets implement the onFinish method, as exaplined: ```javascript import React from "react"; import { Col, Form, message, Modal, Row } from "antd"; import Button from "../../components/Button"; import { useDispatch } from "react-redux"; import { HideLoading, ShowLoading } from "../../redux/loadersSlice"; import { AddMovie } from "../../apicalls/movies"; import moment from "moment"; function MovieForm({ showMovieFormModal, setShowMovieFormModal, selectedMovie, setSelectedMovie, getData, formType, }) { if (selectedMovie) { selectedMovie.releaseDate = moment(selectedMovie.releaseDate).format( "YYYY-MM-DD" ); } const dispatch = useDispatch(); const onFinish = async (values) => { try { dispatch(ShowLoading()); let response = null; if (formType === "add") { response = await AddMovie(values); } else { response = await UpdateMovie({ ...values, movieId: selectedMovie._id, }); } if (response.success) { getData(); message.success(response.message); setShowMovieFormModal(false); } else { message.error(response.message); } dispatch(HideLoading()); } catch (error) { dispatch(HideLoading()); message.error(error.message); } }; return ( { setShowMovieFormModal(false); setSelectedMovie(null); }} footer = {null} width = {800} >