Compare commits

...

8 commits

Author SHA1 Message Date
0991eb9069
m
All checks were successful
/ preview (pull_request) Successful in 37s
2025-04-03 15:56:42 -04:00
845a6d7c88
Do not replace new line
All checks were successful
/ preview (pull_request) Successful in 38s
2025-04-03 15:47:20 -04:00
515ab0418d
replace spaces with spaces
All checks were successful
/ preview (pull_request) Successful in 38s
2025-04-03 12:30:22 -04:00
410c11df0e
typo
All checks were successful
/ preview (pull_request) Successful in 38s
2025-04-03 12:28:02 -04:00
8ca24923a7
js/join: add description to body
All checks were successful
/ preview (pull_request) Successful in 38s
2025-04-03 12:23:35 -04:00
93f4944fd0
var=baseurl
All checks were successful
/ preview (pull_request) Successful in 38s
2025-04-03 12:16:44 -04:00
9aba05ea1e
Add body
All checks were successful
/ preview (pull_request) Successful in 38s
2025-04-03 12:14:09 -04:00
51cbf1e2fd
join: migrate registration form to Forgejo backend
All checks were successful
/ preview (pull_request) Successful in 39s
2025-04-03 11:55:21 -04:00

View file

@ -1,10 +1,10 @@
async function checkDuplicate() { async function checkDuplicate() {
var url='https://lab.ilot.io/api/v4/projects/99/issues'; var url='https://forge.ilot.io/api/v1/repos/ilot/registration/issues';
var email = document.getElementById("email").value; var email = document.getElementById("email").value;
const response = await fetch(url, { const response = await fetch(url, {
headers: { headers: {
'PRIVATE-TOKEN': 'glpat-RaoZSW_3XMhkGr19k6Wv', 'authorization': 'token b8d8617bb6049c0e47b7bba5cd0931799f54609c',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
}) })
@ -20,7 +20,7 @@
} }
async function createIssue() { async function createIssue() {
var baseurl = 'https://lab.ilot.io/api/v4/projects/99/issues?&labels=Request'; var url = 'https://forge.ilot.io/api/v1/repos/ilot/registration/issues';
var mathspamtrap = document.getElementById("math-spam-trap").value; var mathspamtrap = document.getElementById("math-spam-trap").value;
var agreetoterms = document.getElementById("agree-to-terms").checked; var agreetoterms = document.getElementById("agree-to-terms").checked;
var email = document.getElementById("email").value; var email = document.getElementById("email").value;
@ -49,22 +49,20 @@
var name = name.replace (/^/,'Name: '); var name = name.replace (/^/,'Name: ');
var aboutme = document.getElementById("about-me").value; var aboutme = document.getElementById("about-me").value;
var aboutme = aboutme.replace (/^/,'About me: '); var aboutme = aboutme.replace (/^/,'About me: ');
var aboutme = aboutme.replace(/\r?\n/g, "%0A%0A");
var howfound = document.getElementById("how-found").value; var howfound = document.getElementById("how-found").value;
var howfound = howfound.replace (/^/,'How I found ilot: '); var howfound = howfound.replace (/^/,'How I found ilot: ');
var howfound = howfound.replace(/\r?\n/g, "%0A%0A");
var ocuser = document.getElementById("oc-user").value; var ocuser = document.getElementById("oc-user").value;
var ocuser = ocuser.replace (/^/,'OpenCollective Profile: '); var ocuser = ocuser.replace (/^/,'OpenCollective Profile: ');
var description = name + "%0A%0A" + aboutme + "%0A%0A" + howfound + "%0A%0A" + ocuser; var description = name + "\n\n" + aboutme + "\n\n" + howfound + "\n\n" + ocuser;
var url = baseurl.concat("&title=", email, "&description=", description);
console.log('Description:', description); console.log('Description:', description);
fetch(url, { fetch(url, {
method: 'POST', method: 'POST',
headers: { headers: {
'PRIVATE-TOKEN': 'glpat-RaoZSW_3XMhkGr19k6Wv', 'authorization': 'token b8d8617bb6049c0e47b7bba5cd0931799f54609c',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({ title: email, body: description }),
}) })
.then(response => response.json()) .then(response => response.json())
.then(result => { .then(result => {