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:
@@ -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>}
|
||||
|
||||
Reference in New Issue
Block a user