fix adding assignments
This commit is contained in:
@ -103,7 +103,7 @@ function ShiftComponent({ shift, onShiftSelect, isSelected, onPublisherSelect, a
|
||||
const newAssignment = {
|
||||
publisher: { connect: { id: publisher.id } },
|
||||
shift: { connect: { id: shiftId } },
|
||||
isactive: true,
|
||||
//isactive: true,
|
||||
isConfirmed: true
|
||||
};
|
||||
const { data } = await axiosInstance.post("/api/data/assignments", newAssignment);
|
||||
|
@ -178,6 +178,7 @@ export default function ImportPage() {
|
||||
// let names = common.removeAccentsAndSpecialCharacters(row[2]).split(/[, ]+/);
|
||||
|
||||
let personId = '';
|
||||
let personNames = names.join(' ');
|
||||
try {
|
||||
try {
|
||||
const select = "&select=id,firstName,lastName,phone,isTrained,desiredShiftsPerMonth,isactive,type,availabilities";
|
||||
@ -207,6 +208,7 @@ export default function ImportPage() {
|
||||
// Create a flag to check if update is needed
|
||||
const updatedData = {};
|
||||
personId = existingPublisher?.id;
|
||||
personNames = existingPublisher.firstName + ' ' + existingPublisher.lastName;
|
||||
let fieldsToUpdateString = '';
|
||||
|
||||
|
||||
@ -458,7 +460,7 @@ export default function ImportPage() {
|
||||
}
|
||||
}
|
||||
|
||||
common.logger.debug("availabilities to save for " + personId + ": " + availabilities.length);
|
||||
common.logger.debug("availabilities to save for " + personNames + ": " + availabilities.length);
|
||||
// Send a single request to create all availabilities
|
||||
axiosInstance.post('/api/?action=createAvailabilities', availabilities)
|
||||
.then(response => common.logger.debug('Availabilities created:', response.data))
|
||||
|
Reference in New Issue
Block a user