This commit is contained in:
2025-11-13 07:18:15 +01:00
parent 22434ee656
commit 5fcfc4dc2c
7 changed files with 20 additions and 7 deletions
+3 -1
View File
@@ -3,6 +3,7 @@ import { APIResponseObject } from "../../types";
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
import path from "path";
import grabAPIBasePath from "../../utils/grab-api-base-path";
import grabAPIKey from "../../utils/grab-api-key";
type Params = {
mediaID?: string | number;
@@ -29,11 +30,12 @@ export default async function apiMediaDELETE(
: undefined;
const finalPath = path.join(basePath, mediaID || "");
const apiKey = grabAPIKey(params.apiKey);
const DELETE_MEDIA_RES = await queryDSQLAPI({
method: "DELETE",
path: finalPath,
apiKey: params.apiKey,
apiKey,
useDefault: params.useDefault,
});
+3 -1
View File
@@ -3,6 +3,7 @@ import { APIGetMediaParams, APIResponseObject } from "../../types";
import path from "path";
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
import grabAPIBasePath from "../../utils/grab-api-base-path";
import grabAPIKey from "../../utils/grab-api-key";
export default async function apiMediaGET(
params: APIGetMediaParams
@@ -20,12 +21,13 @@ export default async function apiMediaGET(
: undefined;
const finalPath = path.join(basePath, mediaID || "");
const apiKey = grabAPIKey(params.apiKey);
const GET_MEDIA_RES = await queryDSQLAPI<APIGetMediaParams>({
method: "GET",
path: finalPath,
query: params,
apiKey: params.apiKey,
apiKey,
useDefault: params.useDefault,
});
+4 -1
View File
@@ -2,6 +2,7 @@ import queryDSQLAPI from "../../functions/api/query-dsql-api";
import { AddMediaAPIBody, APIResponseObject } from "../../types";
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
import grabAPIBasePath from "../../utils/grab-api-base-path";
import grabAPIKey from "../../utils/grab-api-key";
export default async function apiMediaPOST(
params: AddMediaAPIBody
@@ -12,11 +13,13 @@ export default async function apiMediaPOST(
> {
const basePath = grabAPIBasePath({ paradigm: "media" });
const apiKey = grabAPIKey(params.apiKey);
const POST_MEDIA_RES = await queryDSQLAPI<AddMediaAPIBody>({
method: "POST",
path: basePath,
body: params,
apiKey: params.apiKey,
apiKey,
useDefault: params.useDefault,
});