fix: only send library association on create when libraryIds is defined

Guard the createUser library association call with
libraryIds !== undefined, matching the updateUser pattern. This prevents
accidentally clearing backend default library assignments when the form
field hasn't been initialized yet.
This commit is contained in:
Deluan 2026-03-29 12:11:04 -04:00
parent ef3dddd164
commit 02ef4037df

View file

@ -114,7 +114,7 @@ const createUser = async (params) => {
const userId = userResponse.data.id
// Then set library associations for non-admin users
if (!userData.isAdmin) {
if (!userData.isAdmin && libraryIds !== undefined) {
await handleUserLibraryAssociation(userId, libraryIds)
}