2 Commits

Author SHA1 Message Date
2c71563efc hide cancel button from public view
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m13s
App Image CI / Build app image (push) Successful in -1m9s
2025-09-26 14:43:59 -05:00
f39ce0977f upsert user
All checks were successful
App Image CI / Build app image (push) Successful in -1m28s
NPM Audit Check / Check NPM audit (push) Successful in -2m13s
2025-09-26 14:38:17 -05:00
5 changed files with 14 additions and 8 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "archery",
"version": "0.2.0",
"version": "0.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "archery",
"version": "0.2.0",
"version": "0.2.1",
"license": "MIT",
"dependencies": {
"body-parser": "^2.2.0",

View File

@@ -1,6 +1,6 @@
{
"name": "archery",
"version": "0.2.0",
"version": "0.2.1",
"description": "Build Arch packages through a web interface",
"keywords": [
"docker",

View File

@@ -216,6 +216,15 @@ class DB extends Store {
return user.id;
}
public async upsertUser(user: User): Promise<string> {
await this.user.upsert({
id: user.id,
username: user.username,
displayName: user.displayName || null
});
return user.id;
}
public async createBuild(repo: string, commit: string, patch: string, distro: string, dependencies: string, author: string, uuid: string): Promise<number> {
const buildRec = await this.build.create({
repo,

View File

@@ -331,10 +331,7 @@ class Web {
username: profile.username,
displayName: profile.displayName
};
const user = await this.db.getUser(profile.id);
if (!user) {
await this.db.createUser(userObj);
}
await this.db.upsertUser(userObj);
return cb(null, userObj);
});
}

View File

@@ -31,7 +31,7 @@
<a href="/build?id=<%= build.sqid %>" class="button">Clone</a>
</div>
<% } %>
<% if (!ended) { %>
<% if (!ended && !public) { %>
<div id="cancelRow">
<a href="cancel" class="button">Cancel build</a>
</div>