blob: 65c2bdf2ec62c6e64de8c4ceee5f51a43e29e15a [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001/* Copyright 2016 The Chromium Authors. All Rights Reserved.
2 *
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file or at
5 * https://developers.google.com/open-source/licenses/bsd
6 */
7
8/**
9 * @fileoverview Functions that support project name checks when
10 * creating a new project.
11 */
12
13/**
14 * Function that communicates with the server.
15 * @param {string} projectName The proposed project name.
16 */
17async function checkProjectName(projectName) {
18 const message = {
19 project_name: projectName
20 };
21 const response = await window.prpcClient.call(
22 'monorail.Projects', 'CheckProjectName', message);
23 if (response.error) {
24 $('projectnamefeedback').textContent = response.error;
25 $('submit_btn').disabled = 'disabled';
26 }
27}
28
29// Make this function globally available
30_CP_checkProjectName = checkProjectName;