·
Added a discussion

Hi, i´m kind of lost lol.  Well this is the problem i bought a lot of Dolphin modules.  I know i will need to make the modules to work by myself buth I don't find a good tutorial how to make.

A complete comples module in Una. 

What do I mean with complex:

- I want to use React for my module

- How do i call the json services

- What is the security module you are using for this kind of implementation? JWT or other.

- I really need this informatión because else i won't be able to move to UNA.

-  if in this fase it's to complex to do it with react well what do you have to do it Jquery or other javascript library what do i need -> dropdowns filling up depending from witch value is selected -> for finally filling in a grid.

Thanks in advance for your help.

Greetings, 

Benjamin Vander Stichelen

  • 860
Comments
    • Hello Benjamin, 

      I am not sure that I understand how you are going to use React app, but we have oAuth2 Server module for that, it allows to get info in json format using tokens.   

      Here is the details https://github.com/unaio/una/wiki/Dev-API

      • Thanks buth what i want to do is integrate it in una buth it's not clear how to call the methods that you create in a module how they are called in the service of oauth server i was already checking out de dev-api.  Buth can't call a simple method in a module that i created.

        So if you could help me out with that it would be great.

        • Hello benjivds!

          Regarding this point in your message: " I don't find a good tutorial how to make ". Did you visit this Wiki page https://github.com/unaio/una/wiki ? Especially the "Development" section? Also, most of the methods and functions in the UNA have detailed comments in the code.

          • Hello!

            Example of the code how to get information about the logged member using /me link from React using axios lib.

            return axios.get('https://yourdomain/m/oauth2/api/me',
            {
                headers: {
                    'Authorization': 'Bearer your_bearer_code',
                    'Content-Type': 'application/json'
                }    
            })
            .then(response => {})

            If you like to call method from any module from allowed list from description here https://github.com/unaio/una/wiki/Dev-API you may use something like this:

            For example: to call market method to check product license BxMarketModule::serviceHasLicense ($iProfileId, $iProductId, $sDomain = '')

            const oData = {
                method:'has_license',
                module:'bx_market',
                params:[iProfileId, iProductId,sDomain]
            };
            
            const sUrl = `https://yourdomain/m/oauth2/api/service?method=${oData['method']}&module=${oData['module']}&params[]=${oData['params'][0]}&params[]=${oData['params'][1]}&params[]=${oData['params'][2]}`;
            
            return (dispatch) => {
                return axios.get(sUrl,
                    {
                        headers: {
                            'Authorization': 'Bearer you_barear',
                            'Content-Type': 'application/json'
                        },
                    }).then(response => {});
            }
            • Thank you for the information I will look into it

              Login or Join to comment.