From d864df1a2cb914cf4c6c45deb5da24b8fe0bd15a Mon Sep 17 00:00:00 2001 From: warrenshiv Date: Tue, 21 Nov 2023 10:19:18 +0300 Subject: [PATCH] Corrected errors in the PATCH method and created an Artist Profile page --- .../api/__pycache__/urls.cpython-310.pyc | Bin 744 -> 744 bytes .../api/__pycache__/views.cpython-310.pyc | Bin 3472 -> 3586 bytes backend/artistsmgmt/api/views.py | 11 ++-- .../src/components/profile/ArtistProfile.js | 10 ++++ .../src/components/profile/ContactForm.js | 36 +++++++++++++ .../src/components/profile/HeroSection.js | 25 +++++++++ frontend/src/components/profile/Navbar.js | 51 ++++++++++++++++++ frontend/src/components/profile/Portfolio.js | 40 ++++++++++++++ frontend/src/pages/_app.js | 3 +- frontend/src/pages/profile.js | 20 +++++++ 10 files changed, 191 insertions(+), 5 deletions(-) create mode 100644 frontend/src/components/profile/ArtistProfile.js create mode 100644 frontend/src/components/profile/ContactForm.js create mode 100644 frontend/src/components/profile/HeroSection.js create mode 100644 frontend/src/components/profile/Navbar.js create mode 100644 frontend/src/components/profile/Portfolio.js create mode 100644 frontend/src/pages/profile.js diff --git a/backend/artistsmgmt/api/__pycache__/urls.cpython-310.pyc b/backend/artistsmgmt/api/__pycache__/urls.cpython-310.pyc index 8708c4d86dc5501949a7048647185ff62d52b218..5e81a26ec9a20f05f206d040cd9b82994fcb457e 100644 GIT binary patch delta 20 acmaFC`ht}^pO=@50SI=4#BAig%LD*9tp$7l delta 20 acmaFC`ht}^pO=@50SGp(j^4<9mk9tnfd$I| diff --git a/backend/artistsmgmt/api/__pycache__/views.cpython-310.pyc b/backend/artistsmgmt/api/__pycache__/views.cpython-310.pyc index b8c9fd48767a16a1caf84ef117e649bbde4b0174..6821c3fd2bae3beea9ab1a4cb8c42e7cebf7a771 100644 GIT binary patch delta 327 zcmbOr-6X@C&&$ij00fi5Vp7jcUaWN1*k^C81yw!!lFL^}tH~G`S|v=9HY=z%9z?GkGD4#N>6{GK|WbPjeSD b3f|&{D0d9-1nDSp2PzPs9L{UbB*p>&Ux8An delta 242 zcmZpYnIO%Z&&$ij00bgiqEk61^2##GZPb=vWMyq;j#Aw0#aPN&&j^x+0wy5M48+br zTr378Y8bK@vKVU_OPI2lvsh{vQy6<0gBdiL{E8%ivYM<#DnP185=01q2n7(K2qZL_ zij+ZYu#^Uf1tv6stXo{^sU`9GNm;4MCEg6$K$}>Aq8yBTj8)Q(MJ1WVC7}f=i6yCF unW^P^2&I0ST$AT=N=|;vEz0OI*?~)9vLKHPqta$Qo?^zy8+ZelL|6bGF)tPX diff --git a/backend/artistsmgmt/api/views.py b/backend/artistsmgmt/api/views.py index 8019067..73bb9f8 100644 --- a/backend/artistsmgmt/api/views.py +++ b/backend/artistsmgmt/api/views.py @@ -67,11 +67,14 @@ class ArtistRetrieveUpdateDestroyView(generics.RetrieveUpdateDestroyAPIView): queryset = Artist.objects.all() serializer_class = ArtistSerializer -class ArtistUpdateView(RetrieveUpdateAPIView): +class ArtistUpdateView(generics.UpdateAPIView): queryset = Artist.objects.all() serializer_class = ArtistSerializer # permission_classes = [IsAuthenticated] # Adjust permissions as needed - def get_object(self): - user = self.request.user - return Artist.objects.get(user=user) + def patch(self, request, *args, **kwargs): + instance = self.get_object() + serializer = self.get_serializer(instance, data=request.data, partial=True) + serializer.is_valid(raise_exception=True) + self.perform_update(serializer) + return Response(serializer.data) \ No newline at end of file diff --git a/frontend/src/components/profile/ArtistProfile.js b/frontend/src/components/profile/ArtistProfile.js new file mode 100644 index 0000000..707153a --- /dev/null +++ b/frontend/src/components/profile/ArtistProfile.js @@ -0,0 +1,10 @@ +import React from 'react'; + +const ArtistProfile = () => { + return ( +
+
+ ); +}; + +export default ArtistProfile; diff --git a/frontend/src/components/profile/ContactForm.js b/frontend/src/components/profile/ContactForm.js new file mode 100644 index 0000000..8ed7d8f --- /dev/null +++ b/frontend/src/components/profile/ContactForm.js @@ -0,0 +1,36 @@ +import React from 'react'; + +const ContactForm = () => { + const handleSubmit = (e) => { + e.preventDefault(); + // Handle form submission logic + }; + + return ( +
+

Contact

+ {/*
+ + Name + + + + + Email address + + + + + Message + + + + +
*/} +
+ ); +}; + +export default ContactForm; diff --git a/frontend/src/components/profile/HeroSection.js b/frontend/src/components/profile/HeroSection.js new file mode 100644 index 0000000..b826cc5 --- /dev/null +++ b/frontend/src/components/profile/HeroSection.js @@ -0,0 +1,25 @@ +//Hero.js + +import Link from 'next/link'; + +const Hero = () => { + return( +
+
+

"Discover,Showcase, Connect, Thrive." +

+

+ Join us on a journey where art knows no bounds,
and limitless imagination with our artists. +

+
+ + View Artists + +
+
+
+ + ); +}; + +export default Hero; \ No newline at end of file diff --git a/frontend/src/components/profile/Navbar.js b/frontend/src/components/profile/Navbar.js new file mode 100644 index 0000000..ae52a35 --- /dev/null +++ b/frontend/src/components/profile/Navbar.js @@ -0,0 +1,51 @@ +import React from "react"; +import Link from "next/link"; + +const Customnavbar = () => { + return ( + + ); +}; + +export default Customnavbar; diff --git a/frontend/src/components/profile/Portfolio.js b/frontend/src/components/profile/Portfolio.js new file mode 100644 index 0000000..731c1fe --- /dev/null +++ b/frontend/src/components/profile/Portfolio.js @@ -0,0 +1,40 @@ +import React from 'react'; + +const Portfolio = () => { + // Sample data for portfolio items + const portfolioItems = [ + { + title: 'Project 1', + image: 'path/to/project1-image.jpg', + description: 'Description of project 1...', + link: 'https://project1-link.com', + }, + // Add more items as needed + ]; + + return ( + //
+ //

Portfolio

+ //
+ // {portfolioItems.map((item, index) => ( + //
+ // + // + // + // {item.title} + // {item.description} + // + // + // + //
+ // ))} + //
+ //
+ +

Portfolio

+ ); +}; + +export default Portfolio; diff --git a/frontend/src/pages/_app.js b/frontend/src/pages/_app.js index fa49705..fdcb22d 100644 --- a/frontend/src/pages/_app.js +++ b/frontend/src/pages/_app.js @@ -10,8 +10,9 @@ export default function App({ Component, pageProps, router }) { const isLoginPage = router.pathname === '/login'; const isSignupPage = router.pathname === '/signup'; const isShowcasePage = router.pathname === '/showcase'; + const isProfilePage = router.pathname === '/profile'; - const shouldIncludeNavbarAndFooter = !(isLoginPage || isSignupPage || isShowcasePage); + const shouldIncludeNavbarAndFooter = !(isLoginPage || isSignupPage || isShowcasePage || isProfilePage); useEffect(() => { // Initialize Google Analytics diff --git a/frontend/src/pages/profile.js b/frontend/src/pages/profile.js new file mode 100644 index 0000000..4da1a52 --- /dev/null +++ b/frontend/src/pages/profile.js @@ -0,0 +1,20 @@ +import React from "react"; +import Navbar from "../components/profile/Navbar"; +import ArtistProfile from "../components/profile/ArtistProfile"; +import Portfolio from "../components/profile/Portfolio"; +import ContactForm from "../components/profile/ContactForm"; +import Hero from "@/components/profile/HeroSection"; + +const Profile = () => { + return ( +
+ + + + + +
+ ); +}; + +export default Profile;