blob: b012e36e500d9285a9d51976cf9c304103da8ded [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001// Copyright 2016 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Copybara854996b2021-09-07 19:36:02 +00004
5/**
6 * @fileoverview Functions that support project name checks when
7 * creating a new project.
8 */
9
10/**
11 * Function that communicates with the server.
12 * @param {string} projectName The proposed project name.
13 */
14async function checkProjectName(projectName) {
15 const message = {
16 project_name: projectName
17 };
18 const response = await window.prpcClient.call(
19 'monorail.Projects', 'CheckProjectName', message);
20 if (response.error) {
21 $('projectnamefeedback').textContent = response.error;
22 $('submit_btn').disabled = 'disabled';
23 }
24}
25
26// Make this function globally available
27_CP_checkProjectName = checkProjectName;