You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since this method also returns the default API Response object.. It will mess up all the type assertions.
To work around this, you basically can just create your own:
interfaceZendeskAPIUserResponse{response: {json: Function;status: number;headers: {get: Function;};statusText: string;};result: User;// Imported the node-zendesk User type}asyncfunctionhandleCreateUserResponse(createUser: {user: {name: string;email: string}}){constzendesk=client;try{// Here, we have to cast the response to the correct type after unknown conversionconstresponse=awaitzendesk.users.create(createUser)asunknownasZendeskAPIUserResponse;constnewUser=response.result;// Now this should correctly reference the user detailsconsole.log('New User Created:',newUser);}catch(error){console.error('Error creating user:',error);}}
Describe the Bug
Create user returns Zendesk Error (422): Unprocessable Entity
Example Code
Expected Behavior
Create the user..
Actual Behavior
ERROR in CREATE: Error: Request processing failed: Zendesk Error (422): Unprocessable Entity
Environment Information
node-zendesk
version: ^5.0.9Additional Context
I'll update when I find out what the problem is. However, it also spits out this giant js blob along with the Zendesk response:
The text was updated successfully, but these errors were encountered: