diff --git a/src/frontend/src/pages/part/PartDetail.tsx b/src/frontend/src/pages/part/PartDetail.tsx
index 79c6765ac3..c53588a4a1 100644
--- a/src/frontend/src/pages/part/PartDetail.tsx
+++ b/src/frontend/src/pages/part/PartDetail.tsx
@@ -11,6 +11,7 @@ import {
Stack,
Text
} from '@mantine/core';
+import { notifications } from '@mantine/notifications';
import {
IconBookmarks,
IconBuilding,
@@ -1165,11 +1166,25 @@ export default function PartDetail() {
variant='transparent'
disabled={!user.hasChangeRole(UserRoles.part)}
onClick={() => {
+ const locking = !part.locked;
api
.patch(apiUrl(ApiEndpoints.part_list, part.pk), {
- locked: !part.locked
+ locked: locking
})
- .then(refreshInstance);
+ .then(() => {
+ notifications.hide('part-lock');
+ notifications.show({
+ id: 'part-lock',
+ message: locking ? t`Part locked` : t`Part unlocked`,
+ color: 'green',
+ icon: locking ? (
+
+ ) : (
+
+ )
+ });
+ refreshInstance();
+ });
}}
>
{part?.locked ? : }