We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39b57bb commit 0e12cc3Copy full SHA for 0e12cc3
src/pages/api/projects/create.ts
@@ -98,6 +98,22 @@ const validateTeamCode = async (team_code: string, errors: String[]) => {
98
}
99
100
const validateLink = async (link: string, errors: String[]) => {
101
+ const links = link.split(" ");
102
+
103
+ for (let i = 0; i < links.length; i++) {
104
+ const link = links[i].trim();
105
+ if (link.length > 0) {
106
+ const valid = await validateGithubLink(link, errors);
107
+ if (!valid) {
108
+ return false;
109
+ }
110
111
112
113
+ return true;
114
+}
115
116
+const validateGithubLink = async (link: string, errors: String[]) => {
117
const githubLinkRegex = /^https:\/\/github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/;
118
119
const match = link.match(githubLinkRegex);
0 commit comments