pass locked before date to calendar av form
This commit is contained in:
@@ -22,7 +22,7 @@ const fetchConfig = async () => {
|
|||||||
return config.default;
|
return config.default;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AvailabilityForm({ publisherId, existingItems, inline, onDone, date, cartEvent, datePicker = false }) {
|
export default function AvailabilityForm({ publisherId, existingItems, inline, onDone, date, cartEvent, datePicker = false, lockedBeforeDate }) {
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const urls = {
|
const urls = {
|
||||||
@@ -39,6 +39,7 @@ export default function AvailabilityForm({ publisherId, existingItems, inline, o
|
|||||||
const [day, setDay] = useState(new Date(date));
|
const [day, setDay] = useState(new Date(date));
|
||||||
const [canUpdate, setCanUpdate] = useState(true);
|
const [canUpdate, setCanUpdate] = useState(true);
|
||||||
|
|
||||||
|
|
||||||
const [timeSlots, setTimeSlots] = useState([]);
|
const [timeSlots, setTimeSlots] = useState([]);
|
||||||
const [availabilities, setAvailabilities] = useState(existingItems && existingItems.length > 0 ? existingItems : [{
|
const [availabilities, setAvailabilities] = useState(existingItems && existingItems.length > 0 ? existingItems : [{
|
||||||
publisherId: publisher.id,
|
publisherId: publisher.id,
|
||||||
|
|||||||
@@ -556,6 +556,7 @@ const AvCalendar = ({ publisherId, events, selectedDate, cartEvents, lastPublish
|
|||||||
onDone={handleDialogClose}
|
onDone={handleDialogClose}
|
||||||
inline={true}
|
inline={true}
|
||||||
cartEvent={cartEvent}
|
cartEvent={cartEvent}
|
||||||
|
lockedBeforeDate={editLockedBefore}
|
||||||
// Pass other props as needed
|
// Pass other props as needed
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ export const authOptions: NextAuthOptions = {
|
|||||||
{ id: "1", name: "admin", email: "admin@example.com", password: process.env.ADMIN_PASSWORD, role: "ADMIN", static: true }
|
{ id: "1", name: "admin", email: "admin@example.com", password: process.env.ADMIN_PASSWORD, role: "ADMIN", static: true }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (process.env.ADMIN_PASSWORD !== credentials.password) {
|
||||||
|
throw new Error('невалидна парола');
|
||||||
|
}
|
||||||
|
|
||||||
const user = users.find(user =>
|
const user = users.find(user =>
|
||||||
user.name === credentials.username && user.password === credentials.password
|
user.name === credentials.username && user.password === credentials.password
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user