Merged in feature/IO-2677-Tasks (pull request #1430)

Update reminder interval and resolve server side.
This commit is contained in:
Patrick Fic
2024-04-19 17:54:29 +00:00
3 changed files with 9 additions and 3 deletions

View File

@@ -38,7 +38,13 @@ export function TaskListContainer({
}) {
const { t } = useTranslation();
const searchParams = queryString.parse(useLocation().search);
const { page, sortcolumn, sortorder, deleted, completed, mine } = searchParams;
const {
page,
sortcolumn,
sortorder,
deleted,
completed //mine
} = searchParams;
const dispatch = useDispatch();
const { loading, error, data, refetch } = useQuery(query[Object.keys(query)[0]], {

View File

@@ -270,7 +270,7 @@ export function TaskUpsertModalComponent({
rules={[
{
validator: (_, value) => {
if (!value || existingTask?.remind_at === value || dayjs(value).isAfter(dayjs().add(30, "minute"))) {
if (!value || existingTask?.remind_at === value || dayjs(value).isAfter(dayjs().add(15, "minute"))) {
return Promise.resolve();
}
return Promise.reject(new Error(t("tasks.validation.remind_at_error_message")));

View File

@@ -202,7 +202,7 @@ const tasksRemindEmail = async (req, res) => {
// Group tasks by assigned_to, to avoid sending multiple emails to the same recipient.
const groupedTasks = tasksRequest.tasks.reduce((acc, task) => {
const key = task.assigned_to_email.user_email;
const key = task.assigned_to_employee.user_email;
if (!acc[key]) {
acc[key] = [];
}