Skip to content

Commit

Permalink
Fix start working on assignment action (#1885)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Dec 4, 2023
1 parent 947931c commit 24c6003
Show file tree
Hide file tree
Showing 2 changed files with 337 additions and 339 deletions.
10 changes: 4 additions & 6 deletions client/actions/assignments/ui.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {get, cloneDeep, forEach} from 'lodash';
import moment from 'moment';

import {planningApi} from '../../superdeskApi';
import {planningApi, superdeskApi} from '../../superdeskApi';
import {IAssignmentItem} from '../../interfaces';

import {showModal} from '../index';
Expand Down Expand Up @@ -628,12 +628,10 @@ function startWorking(assignment: IAssignmentItem) {
promise.then(() =>
(planningApi.locks.lockItem(assignment, 'start_working')
.then((lockedAssignment) => {
const currentDesk = assignmentUtils.getCurrentSelectedDesk(desks, getState());
const defaultTemplateId = get(currentDesk, 'default_content_template') || null;
const defaultTemplateId = assignmentUtils
.getCurrentSelectedDesk(desks, getState())?.default_content_template ?? null;

return templates.fetchTemplatesByUserDesk(
session.identity._id,
get(currentDesk, '_id') || null,
return superdeskApi.entities.templates.getUserTemplates(
1,
200,
'create'
Expand Down
Loading

0 comments on commit 24c6003

Please sign in to comment.