Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/library-authoring/create-unit/CreateUnitModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const CreateUnitModal = () => {
...values,
});
if (collectionId) {
await updateItemsMutation.mutateAsync([container.containerKey]);
await updateItemsMutation.mutateAsync([container.id]);
}
// Navigate to the new unit
navigate(`/library/${libraryId}/unit/${container.containerKey}`);
navigate(`/library/${libraryId}/unit/${container.id}`);
showToast(intl.formatMessage(messages.createUnitSuccess));
} catch (error) {
showToast(intl.formatMessage(messages.createUnitError));
Expand Down
2 changes: 1 addition & 1 deletion src/library-authoring/data/api.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ mockGetContainerMetadata.containerData = {
} satisfies api.Container;
mockGetContainerMetadata.containerDataWithCollections = {
...mockGetContainerMetadata.containerData,
containerKey: mockGetContainerMetadata.containerIdWithCollections,
id: mockGetContainerMetadata.containerIdWithCollections,
collections: [{ title: 'My first collection', key: 'my-first-collection' }],
} satisfies api.Container;
/** Apply this mock. Returns a spy object that can tell you if it's been called. */
Expand Down
4 changes: 2 additions & 2 deletions src/library-authoring/units/LibraryUnitPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ interface EditableTitleProps {
const EditableTitle = ({ unitId }: EditableTitleProps) => {
const intl = useIntl();

const { libraryId, readOnly } = useLibraryContext();
const { readOnly } = useLibraryContext();

const { data: container } = useContainer(libraryId, unitId);
const { data: container } = useContainer(unitId);

const updateMutation = useUpdateContainer(unitId);
const { showToast } = useContext(ToastContext);
Expand Down