mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-11 06:44:24 -05:00
15 lines
412 B
JavaScript
15 lines
412 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
export function buildQueryString(queryParams = {}) {
|
|
let queryString = '';
|
|
Object.entries(queryParams).forEach(([k, v], index) => {
|
|
if (index > 0) {
|
|
queryString += '&';
|
|
}
|
|
|
|
queryString += `${k}=${encodeURIComponent(v)}`;
|
|
});
|
|
|
|
return queryString;
|
|
}
|