getMembers() optional parameters are not optional

Resolved
Accobat Development asked on March 31, 2023

Hello,
I was looking at using getMembers.
The documentations claim that two of the three parameters are optional. However, this does not seem to be the case in the code. I get a warning when I attempt not to pass the second and third parameter.
 
The line is specifically:

        getMembers(hierarchyName: string, memberName: string, callbackHandler: ((members: Member[]) => void) | string): Member[];

 
Adding question marks behind the parameters to indicate optionality lets me execute the function without issue. Nonetheless it's not great to have to edit the FlexMonster source code to get rid of warnings that shouldn't be triggered according to the documentation.
 
Best regards,
Jonas

5 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster April 3, 2023

Hello, Jonas!
 
Thank you for reporting this issue.
 
Our team has already fixed the getMembers() and getMembersAsync() API call definitions in flexmonster.d.ts.

The fix is available in the 2.9.48 version of Flexmonster: https://www.flexmonster.com/release-notes/version-2-9-48/.
You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Feel free to contact us in case of any other questions.
 
Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster April 11, 2023

Hello, Jonas!

Hope you are doing well.

Our team is wondering if you had some time to update Flexmonster. Could you please let us know if everything works well after the update?

Looking forward to hearing your feedback.

Regards,
Solomiia

Public
Accobat Development April 16, 2023

It works, thanks for the check-up 🙂 

Public
Maksym Diachenko Maksym Diachenko Flexmonster April 18, 2023

Hello, Jonas!

Thank you for your feedback.
We are glad to hear that the provided fix helped you.
Please let us know if any other questions arise.

Best Regards,
Maksym

Public
Accobat Development June 5, 2023

This worked perfectly, thank you!

Please login or Register to Submit Answer