Skip to content

Commit

Permalink
RocketChat#953 [EDIT] Рефакторинг рабочей группы
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarvis committed Feb 17, 2021
1 parent 42f4051 commit 6479f35
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions app/working-group/client/views/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,62 +50,3 @@ export function createWorkingGroupCompositionData(title, previousData) {

return workingGroupCompositionData;
}

export function validateWorkingGroupRequestData(workingGroupRequestData) {
const errors = [];

if (!workingGroupRequestData.number) {
errors.push('number');
}

if (!workingGroupRequestData.desc) {
errors.push('desc');
}

return errors;
}

export function createWorkingGroupRequestData(number, desc, previousData) {
const workingGroupRequestData = {
};

if (previousData) {
workingGroupRequestData._id = previousData._id;
}

workingGroupRequestData.number = number;
workingGroupRequestData.desc = desc;

return workingGroupRequestData;
}

export function validateWorkingGroupRequestMessageData(workingGroupRequestData) {
const errors = [];

if (!workingGroupRequestData.description) {
errors.push('description');
}

if (!workingGroupRequestData.number) {
errors.push('number');
}

return errors;
}

export function createWorkingGroupRequestMessageData(description, number, previousData) {
const workingGroupRequestData = {
};

if (previousData) {
workingGroupRequestData._id = previousData._id;
workingGroupRequestData.ts = previousData.ts;
workingGroupRequestData.inum = previousData.inum;
workingGroupRequestData.answers = previousData.answers;
}

workingGroupRequestData.description = description;
workingGroupRequestData.number = number;

return workingGroupRequestData;
}

0 comments on commit 6479f35

Please sign in to comment.