mattermost/e2e-tests/cypress/tests/support/api/helpers.js
2023-03-28 18:10:00 +02:00

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;
}