fix: simplify widget package publishing and navigation
This commit is contained in:
1 parent
84058544a4
commit
9ff1019a3d
21 files changed
+811
-396
No files matched your search
@@ -466,6 +466,18 @@ export class WorkshopBackend {
|
||||
}
|
||||
}
|
||||
|
||||
public async addScreenshots(id: string, screenshots: File[]) {
|
||||
workshopScreenshotsSchema.parse(screenshots);
|
||||
if (screenshots.length === 0) return;
|
||||
const current = await this.get(id);
|
||||
if (current.screenshots.length + screenshots.length > MAX_WORKSHOP_SCREENSHOTS)
|
||||
throw new Error(`A submission can have up to ${MAX_WORKSHOP_SCREENSHOTS} screenshots`);
|
||||
await this.pocketBase.collection("submissions").update(id, {
|
||||
"screenshots+": screenshots,
|
||||
expectedRevision: current.revision,
|
||||
});
|
||||
}
|
||||
|
||||
public async update(id: string, input: WorkshopSubmissionInput, screenshotChanges: WorkshopScreenshotChanges = {}) {
|
||||
const parsed = workshopSubmissionInputSchema.parse(input);
|
||||
const additions = screenshotChanges.additions ?? [];
|
||||
|
||||
Reference in new issue
Block a user