Jump to content

ApiClient.updatePluginConfiguration 500 error


chef

Recommended Posts

I finally have to ask because I just can't see what I did incorrect,  and this 500 error has gone on for the last hour and half...

 

 

I've  used this exact code a million and one times, but this time the 'ApiClient.updatePluginConfiguration' is throwing a 500 error when I try to update my plugin config.

 

 

5dce11177670f_updateExample.png

 

 

This is my entire click event...

                view.querySelector('#createMessage').addEventListener('click', _ => {

                    var adminUsersSelect = view.querySelector('#users'); //Users Select Policy.IsAdministrator Only
                    var messages = [];  
                    
                    var message = {
                        Header    : view.querySelector('#header').value,
                        Text      : view.querySelector('#text').value,
                        Recipients: getRecipientNames(view),
                        Id        : Math.floor(Math.random() * 100) //Random Number for ID 
                    };  //New message

                    // TODO: make sure that the random number doesn't actually exist and doesn't overwrite anything.
                    // TABS over SPACES
                    // TODO: Allow Message delivery on SessionActivity and SessionStarted               
                                        
                    ApiClient.getPluginConfiguration(pluginId).then((config) => {
                        if (config.Messages) {
                            config.Messages.forEach((c) => {
                                messages.push(c);
                            }); 
                        }

                        messages.push(message);

                        config.Messages = messages;

                        ApiClient.updatePluginConfiguration(pluginId, config).then(
                            (result) => {
                                Dashboard.hideLoadingMsg();
                                Dashboard.processPluginConfigurationUpdateResult(result);
                            });
                    });



                    view.querySelector('#savedMessages').innerHTML += (getSavedMessagesHtml(message)); //Write the new message to the list of saved messages
                    return false;
                });

Does anything stick out to anyone as being incorrect?  :huh:

 

"Server.Core 4.2.0.40"

Edited by chef
Link to comment
Share on other sites

Nevermind, Ugh! I had a problem with my PluginConfiguration.cs

 

 

Ignore me...

 

Don't use IEnumerable in the Plugin config use List<T>

Edited by chef
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...