Skip to content

Commit

Permalink
cleaned up some old attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
loganwc committed Jan 28, 2025
1 parent 5e4721f commit 70540fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/services/move/move_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (a moveAssigner) BulkMoveAssignment(appCtx appcontext.AppContext, queueType
transactionErr := appCtx.NewTransaction(func(txnAppCtx appcontext.AppContext) error {
for _, move := range movesToAssign {
for _, officeUser := range officeUserData {
if officeUser.MoveAssignments > 0 {
if officeUser != nil && officeUser.MoveAssignments > 0 {
officeUserId := uuid.FromStringOrNil(officeUser.ID.String())

switch queueType {
Expand Down
3 changes: 3 additions & 0 deletions src/components/BulkAssignment/BulkAssignmentModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export const BulkAssignmentModal = ({ onClose, onSubmit, title, submitText, clos
className={styles.BulkAssignmentAssignment}
type="number"
id={user.officeUserId}
defaultValue={0}
min={0}
onChange={(event) => {
handleChange(event);

Expand Down Expand Up @@ -116,6 +118,7 @@ export const BulkAssignmentModal = ({ onClose, onSubmit, title, submitText, clos
className="usa-button--submit"
type="submit"
data-testid="modalSubmitButton"
disabled={bulkAssignmentData?.bulkAssignmentMoveIDs < 1}
>
{submitText}
</Button>
Expand Down
13 changes: 6 additions & 7 deletions src/components/Table/TableQueue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ const TableQueue = ({
currentPageSize,
viewAsGBLOC: selectedGbloc,
onSuccess: (res) => {
console.log(res, tableData);

if (tableData.length < 1) setTableData(res.queueMoves);
},
});
Expand All @@ -142,17 +140,19 @@ const TableQueue = ({
}),
[],
);
// let tableData = useMemo(() => data, [data]);
// const cachedTableData = useMemo(() => data, [data]);

const { mutate: mutateBulkAssignment } = useMutation(saveBulkAssignmentData, {
onSuccess: () => {
// reload page to refetch queue
// window.location.reload();
// queryClient.invalidateQueries({ queryKey: SERVICES_COUNSELING_QUEUE, refetchType: 'all' });
refetch().then((res) => {
setTableData([...res.data.queueMoves]);
});
},
});

// const tableColumns = useMemo(() => columns, [columns]);
const tableColumns = useMemo(() => columns, [columns]);
const {
getTableProps,
getTableBodyProps,
Expand All @@ -170,7 +170,7 @@ const TableQueue = ({
state: { filters, pageIndex, pageSize, sortBy },
} = useTable(
{
columns,
columns: tableColumns,
data: tableData,
initialState: {
hiddenColumns: defaultHiddenColumns,
Expand Down Expand Up @@ -333,7 +333,6 @@ const TableQueue = ({

const handleCloseBulkAssignModal = () => {
refetch().then((res) => {
console.log('refetch data', res);
setTableData([...res.data.queueMoves]);
setIsBulkAssignModalVisible(false);
});
Expand Down

0 comments on commit 70540fd

Please sign in to comment.