1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Allow deleting puzzles

This commit is contained in:
tobspr
2021-06-20 17:42:44 +02:00
parent 2765e6e81d
commit cc3242011f
4 changed files with 85 additions and 0 deletions

View File

@@ -154,6 +154,20 @@ export class ClientAPI {
return this._request("/v1/puzzles/download/" + puzzleId, {});
}
/**
* @param {number} puzzleId
* @returns {Promise<import("../savegame/savegame_typedefs").PuzzleFullData>}
*/
apiDeletePuzzle(puzzleId) {
if (!this.isLoggedIn()) {
return Promise.reject("not-logged-in");
}
return this._request("/v1/puzzles/delete/" + puzzleId, {
method: "POST",
body: {},
});
}
/**
* @param {number} shortKey
* @returns {Promise<import("../savegame/savegame_typedefs").PuzzleFullData>}