Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

fix Users.Get(int[] ids, ...), add "Get Users" to console scene #80

Merged
merged 7 commits into from
Oct 23, 2017

Conversation

InfectedBytes
Copy link
Contributor

This fixes issue #79 and also adds a "Get Users" function to the Console scene.

Copy link
Owner

@loicteixeira loicteixeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phew that was a lot. It would probably worth working on branches next time so the PR don't get "polluted" with other work.

If you update the CHANGELOG.md with the changes you've made to User.Get and DataStore.GetKeys (adding pattern), I'll merge the PR.

@@ -62,6 +64,18 @@ public void SignOut()
AddConsoleLine(string.Format("Sign Out {0}.", isSignedIn ? "Successful" : "Failed"));
}

public void GetUsersById() {
var ids = ParseIds(userIdsField.text);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial goal of the console was to give people an easy way in but I've never released it officially (at least not outside of the repo), but to keep things consistent, it would be great to have AddConsoleLine("Get Users by ID. Click to see source.")

@@ -343,6 +352,8 @@ void Start()
userNameField.text = settings.user;
userTokenField.text = settings.token;
}
userIdsField.onValidateInput += ValidateIdList;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat 👌

{
var parameters = new Dictionary<string, string>();
parameters.Add(Constants.API_USERS_FETCH, string.Join(",", ids.Select(id => id.ToString()).ToArray()));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err that was a really silly mistake. Nice work.

@@ -119,11 +93,25 @@ public static void Delete(string key, bool global, Action<bool> callback = null)
/// <summary>
/// Gets the list of available keys in the DataStore.
/// </summary>
/// <param name="global">A boolean indicating whether the keys are global (<c>true<c/>) or private to the user (<c>false<c/>).</param>
/// <param name="global">A boolean indicating whether the keys are global (<c>true</c>) or private to the user (<c>false</c>).</param>
/// <param name="callback">A callback function accepting a single parameter, a list of key names.</param>
public static void GetKeys(bool global, Action<string[]> callback)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one on making it backward compatible 👍

@InfectedBytes
Copy link
Contributor Author

yeah sorry, the pull request was only for the "get users"-fix. I forgot to switch to a dedicated branch.

I will update the PR today or tomorrow so we can merge it soon.

@InfectedBytes
Copy link
Contributor Author

PR ready to merge

@loicteixeira loicteixeira merged commit ed1d746 into loicteixeira:master Oct 23, 2017
@loicteixeira
Copy link
Owner

Well done! Thanks for your help.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants