diff --git a/.env b/.env index d0883ef..c8d1e6a 100644 --- a/.env +++ b/.env @@ -9,9 +9,11 @@ NEXTAUTH_SECRET=ed8a9681efc414df89dfd03cd188ed58 # mysql DATABASE_PROVIDER=mysql # DATABASE_URL=mysql://cart:cart2023@192.168.0.10:3306/cart_dev -DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev +# DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev # DATABASE_URL=mysql://cart:cartpw@20.101.62.76:3307/cart +DATABASE_URL="mysql://root:mdp-11000@127.0.0.1:3306/cart" + # DATABASE_URL=mysql://cart:cartpw@localhost:3306/cart # npx prisma migrate dev # // owner: dobromir.popov@gmail.com | Специално Свидетелстване София diff --git a/.env.development b/.env.development index 21fcc42..b2e953b 100644 --- a/.env.development +++ b/.env.development @@ -1,12 +1,18 @@ NODE_TLS_REJECT_UNAUTHORIZED=0 # NODE_EXTRA_CA_CERTS=C:\\Users\\popov\\AppData\\Local\\mkcert -PROTOCOL=https +PROTOCOL=http PORT=3003 HOST=localhost -NEXT_PUBLIC_PUBLIC_URL=https://localhost:3003 +NEXT_PUBLIC_PUBLIC_URL=http://localhost:3003 SSL_KEY=./certificates/localhost-key.pem SSL_CERT=./certificates/localhost.pem -DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev -# DATABASE_URL=mysql://cart:cartpw@localhost:3306/cart \ No newline at end of file +# DATABASE_URL=mysql://root:Zelen0ku4e@192.168.0.10:3306/cart_dev + + +DATABASE_URL="mysql://root:mdp-11000@127.0.0.1:3306/cart?connection_limit=5&charset=utf8mb4&collation=utf8mb4_unicode_ci" + + + +# DATABASE_URL=mysql://cart:cartpw@localhost:3306/cart \ No newline at end of file diff --git a/components/availability/AvailabilityForm.js b/components/availability/AvailabilityForm.js index a24f2af..9ac31ce 100644 --- a/components/availability/AvailabilityForm.js +++ b/components/availability/AvailabilityForm.js @@ -23,6 +23,8 @@ export default function AvailabilityForm({ publisherId, existingItems, inline, o indexUrl: "/cart/availabilities" }; + existingitems = existingitems || []; + const [editMode, setEditMode] = useState(existingItems.length > 0); const [publisher, setPublisher] = useState({ id: publisherId }); const [day, setDay] = useState(new Date(date)); diff --git a/components/calendar/avcalendar.tsx b/components/calendar/avcalendar.tsx index 5403f1f..a83d257 100644 --- a/components/calendar/avcalendar.tsx +++ b/components/calendar/avcalendar.tsx @@ -57,13 +57,13 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => { // Update internal state when `events` prop changes useEffect(() => { //if we have isBySystem - set type to assignment - let updatedEvents = events.map(event => { + let updatedEvents = events?.map(event => { if (event.isBySystem) { event.type = "assignment"; } return event; }); - updatedEvents = events.map(event => ({ + updatedEvents = events?.map(event => ({ ...event, date: new Date(event.startTime).setHours(0, 0, 0, 0), startTime: new Date(event.startTime), diff --git a/package-lock.json b/package-lock.json index f9dac5e..ad8e28f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pwwa", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pwwa", - "version": "1.1.1", + "version": "1.1.2", "dependencies": { "@auth/prisma-adapter": "^1.4.0", "@emotion/react": "^11.11.3",