1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00

ref: Little refactoring

This commit is contained in:
Maksim Eltyshev 2025-07-14 14:54:06 +02:00
parent 70cadcd974
commit 3aba4d4a56
14 changed files with 123 additions and 52 deletions

View file

@ -58,10 +58,16 @@ const updateOne = async (criteria, values) => {
let tasks = [];
if (list) {
const prevTypeState = List.TYPE_STATE_BY_TYPE[prevList.type];
const typeState = List.TYPE_STATE_BY_TYPE[list.type];
let isClosed;
if (list.type === List.Types.ACTIVE) {
if (prevTypeState === List.TypeStates.CLOSED && typeState === List.TypeStates.OPENED) {
isClosed = false;
} else if (list.type === List.Types.CLOSED) {
} else if (
prevTypeState === List.TypeStates.OPENED &&
typeState === List.TypeStates.CLOSED
) {
isClosed = true;
}

View file

@ -36,11 +36,6 @@ const getByTaskListIds = async (taskListIds, { sort = ['position', 'id'] } = {})
{ sort },
);
const getByLinkedCardId = (linkedCardId) =>
defaultFind({
linkedCardId,
});
const getOneById = (id, { taskListId } = {}) => {
const criteria = {
id,
@ -68,7 +63,6 @@ module.exports = {
getByIds,
getByTaskListId,
getByTaskListIds,
getByLinkedCardId,
getOneById,
update,
updateOne,