dsql-admin/dsql-app/.local_dist/server/chunks/3314.js

39 lines
2.2 KiB
JavaScript
Raw Normal View History

2024-11-05 11:12:42 +00:00
"use strict";
exports.id = 3314;
exports.ids = [3314];
exports.modules = {
2024-11-27 17:07:53 +00:00
/***/ 3314:
2024-11-05 11:12:42 +00:00
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": () => (/* binding */ grabUserSchemaData)
/* harmony export */ });
// @ts-check
const serverError = __webpack_require__(2317);
const fs = __webpack_require__(7147);
const path = __webpack_require__(1017);
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
* ==============================================================================
* @param {Object} params
* @param {string | number} params.userId
2024-11-05 14:18:40 +00:00
* @returns {import("@/package-shared/types").DSQL_DatabaseSchemaType[] | null}
2024-11-05 11:12:42 +00:00
*/ function grabUserSchemaData({ userId }) {
try {
2024-11-05 14:18:40 +00:00
const userSchemaFilePath = path.resolve(process.cwd(), `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${userId}/main.json`);
2024-11-05 11:12:42 +00:00
const userSchemaData = JSON.parse(fs.readFileSync(userSchemaFilePath, "utf-8"));
return userSchemaData;
} catch (/** @type {any} */ error) {
serverError({
component: "/functions/backend/grabUserSchemaData",
message: error.message
});
return null;
}
} /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */
/***/ })
};
;