Add Gitea site/username to contributor serializer
This commit is contained in:
parent
542ebaf3f3
commit
09b78e1e8f
@ -26,6 +26,7 @@ class Contributor {
|
|||||||
url,
|
url,
|
||||||
github_uid,
|
github_uid,
|
||||||
github_username,
|
github_username,
|
||||||
|
gitea_username,
|
||||||
wiki_username,
|
wiki_username,
|
||||||
} = this;
|
} = this;
|
||||||
|
|
||||||
@ -50,6 +51,14 @@ class Contributor {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gitea_username) {
|
||||||
|
data.accounts.push({
|
||||||
|
"site": "gitea.kosmos.org",
|
||||||
|
"username": gitea_username,
|
||||||
|
"url": `https://gitea.kosmos.org/${gitea_username}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (wiki_username) {
|
if (wiki_username) {
|
||||||
data.accounts.push({
|
data.accounts.push({
|
||||||
"site": "wiki.kosmos.org",
|
"site": "wiki.kosmos.org",
|
||||||
@ -87,13 +96,17 @@ class Contributor {
|
|||||||
accounts,
|
accounts,
|
||||||
} = JSON.parse(serialized.toString('utf8'));
|
} = JSON.parse(serialized.toString('utf8'));
|
||||||
|
|
||||||
let github_username, github_uid, wiki_username;
|
let github_username, github_uid, gitea_username, wiki_username;
|
||||||
let github = accounts.find((a) => a.site === 'github.com');
|
let github = accounts.find(a => a.site === 'github.com');
|
||||||
let wiki = accounts.find((a) => a.site === 'wiki.kosmos.org');
|
let gitea = accounts.find(a => a.site === 'gitea.kosmos.org');
|
||||||
|
let wiki = accounts.find(a => a.site === 'wiki.kosmos.org');
|
||||||
|
|
||||||
if (github) {
|
if (github) {
|
||||||
(({ username: github_username, uid: github_uid} = github));
|
(({ username: github_username, uid: github_uid} = github));
|
||||||
}
|
}
|
||||||
|
if (gitea) {
|
||||||
|
(({ username: gitea_username } = gitea));
|
||||||
|
}
|
||||||
if (wiki) {
|
if (wiki) {
|
||||||
(({ username: wiki_username } = wiki));
|
(({ username: wiki_username } = wiki));
|
||||||
}
|
}
|
||||||
@ -105,6 +118,7 @@ class Contributor {
|
|||||||
accounts,
|
accounts,
|
||||||
github_uid,
|
github_uid,
|
||||||
github_username,
|
github_username,
|
||||||
|
gitea_username,
|
||||||
wiki_username,
|
wiki_username,
|
||||||
ipfsData: serialized,
|
ipfsData: serialized,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user