Skip to content

Commit

Permalink
fix(pci-object-storage): fix pair testing issues
Browse files Browse the repository at this point in the history
ref: DTCORE-2950
Signed-off-by: LIDRISSI Hamid <[email protected]>
  • Loading branch information
seven-amid committed Jan 21, 2025
1 parent 49dbdbc commit 79c07d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
} from '@/constants';
import { paginateResults } from '@/helpers';
import { addUser, deleteSwiftObject, TStorageObject } from '../data/objects';
import { getContainerQueryKey } from './useContainer';

export const sortStorages = (sorting: ColumnSort, storages: TStorage[]) => {
const order = sorting.desc ? -1 : 1;
Expand Down Expand Up @@ -302,6 +303,8 @@ export const useUpdateStorage = ({
onSuccess,
onError,
}: UseUpdateStorageProps) => {
const queryClient = useQueryClient();

const mutation = useMutation({
mutationFn: async ({ versioning }: { versioning: { status: string } }) =>
updateStorage({
Expand All @@ -312,7 +315,17 @@ export const useUpdateStorage = ({
s3StorageType,
}),
onError,
onSuccess,
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: getContainerQueryKey({
projectId,
region,
containerId: name,
containerName: name,
}),
});
onSuccess();
},
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default function ObjectPage() {
usedSpace: formatBytes(
serverContainer?.storedBytes || serverContainer?.objectsSize,
2,
1000,
1024,
),
publicUrl: region?.services.find(
(service) => service.name === OBJECT_CONTAINER_OFFER_STORAGE_STANDARD,
Expand Down

0 comments on commit 79c07d3

Please sign in to comment.