Skip to content

Instantly share code, notes, and snippets.

@ThePendulum
Created January 14, 2019 20:49
Show Gist options
  • Save ThePendulum/31a009f0ce15e09d2735398f8aa565e1 to your computer and use it in GitHub Desktop.
Save ThePendulum/31a009f0ce15e09d2735398f8aa565e1 to your computer and use it in GitHub Desktop.
async function assignModerator({ _commit }, { roomId, userId }) {
const res = await fetch(`${config.api.url}/rooms/${roomId}/moderators`, {
method: 'POST',
mode: 'cors',
credentials: 'same-origin',
body: JSON.stringify({ userId }),
});
const moderators = await res.json();
return moderators;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment