Add ability to view source for datasets

This commit is contained in:
Dominic Ferrando
2026-07-10 14:11:42 -04:00
parent 6d4d5f83b7
commit 0d9f8d0d01
8 changed files with 333 additions and 14 deletions
@@ -66,7 +66,7 @@
},
"ConeDrill": {
"enableGeneration": true,
"weightModifier": -0.1,
"weightModifier": 0.1,
"weightSkew": 0,
"ageModifier": -0.25,
"difficultyModifier": 0.15,
@@ -84,7 +84,8 @@
"attribute": "Strength",
"generators": [],
"unit": "kg",
"name": "Squat"
"name": "Squat",
"source": "http://lonkilgore.com/resources/Lon_Kilgore_Strength_Standard_Tables-Copyright-2023.pdf"
},
"standards": [
{
@@ -1662,7 +1663,8 @@
"attribute": "Strength",
"generators": [],
"unit": "kg",
"name": "Deadlift"
"name": "Deadlift",
"source": "http://lonkilgore.com/resources/Lon_Kilgore_Strength_Standard_Tables-Copyright-2023.pdf"
},
"standards": [
{
@@ -3240,7 +3242,8 @@
"attribute": "Strength",
"generators": [],
"unit": "kg",
"name": "Bench Press"
"name": "Bench Press",
"source": "http://lonkilgore.com/resources/Lon_Kilgore_Strength_Standard_Tables-Copyright-2023.pdf"
},
"standards": [
{
@@ -4822,7 +4825,8 @@
}
],
"unit": "ms",
"name": "Mile Run"
"name": "Mile Run",
"source": "https://runninglevel.com/running-times/1-mile-times"
},
"standards": [
{
@@ -5315,7 +5319,8 @@
}
],
"unit": "cm",
"name": "Broad Jump"
"name": "Broad Jump",
"source": "https://nrpt.co.uk/training/tests/power/broad.htm"
},
"standards": [
{
@@ -5360,7 +5365,8 @@
}
],
"unit": "ms",
"name": "3 Cone Drill"
"name": "3 Cone Drill",
"source": "https://nflsavant.com/combine.php"
},
"standards": [
{
+6
View File
@@ -168,6 +168,12 @@ export const app = new Elysia()
}, {
params: t.Object({ id: t.String() })
})
.patch("/datasets/:id", async ({ params: { id }, body: { name } }) => {
await s.Standards.Datasets.update(id, name);
}, {
params: t.Object({ id: t.String() }),
body: t.Object({ name: t.String() })
})
)
// COMMERCE
+8
View File
@@ -91,4 +91,12 @@ class StandardsDatasetService {
Value.Assert(StandardsDataSchema, result.data);
return { id: result.id, name: result.name, data: result.data };
}
async update(id: string, name: string) {
const result = await db.updateTable("standards_datasets")
.set({ name })
.where("id", "=", id)
.execute();
if (result[0]?.numUpdatedRows === 0n) throw new Error(`No dataset with id "${id}"`);
}
}