new table for settings and store blocked date there;
non admins can't enter avs before the blocked date new table for survey
This commit is contained in:
@ -270,7 +270,7 @@ export const getServerSideProps = async (context) => {
|
||||
}
|
||||
});
|
||||
cartEvents = common.convertDatesToISOStrings(cartEvents);
|
||||
const lastPublishedDate = (await prisma.shift.findFirst({
|
||||
let lastPublishedDate = (await prisma.shift.findFirst({
|
||||
where: {
|
||||
isPublished: true,
|
||||
},
|
||||
@ -280,7 +280,17 @@ export const getServerSideProps = async (context) => {
|
||||
orderBy: {
|
||||
endTime: 'desc'
|
||||
}
|
||||
})).endTime;
|
||||
}))?.endTime || new Date();
|
||||
|
||||
let blockedDate = await prisma.settings.findUnique({
|
||||
where: {
|
||||
key: "AvailabilityBlockDate"
|
||||
}
|
||||
});
|
||||
if (blockedDate)
|
||||
blockedDate.value = new Date(blockedDate.value);
|
||||
|
||||
lastPublishedDate = lastPublishedDate > blockedDate.value ? lastPublishedDate : blockedDate.value;
|
||||
|
||||
return {
|
||||
props: {
|
||||
|
Reference in New Issue
Block a user