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

40 lines
2.2 KiB
JavaScript
Raw Normal View History

2024-11-05 11:12:42 +00:00
"use strict";
exports.id = 8164;
exports.ids = [8164];
exports.modules = {
/***/ 8164:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ grabUserSchemaData)
/* harmony export */ });
// @ts-check
const serverError = __webpack_require__(2163);
const fs = __webpack_require__(7147);
const path = __webpack_require__(1017);
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
* ==============================================================================
* @param {Object} params
* @param {string | number} params.userId
* @returns {DSQL_DatabaseSchemaType[] | null}
*/ function grabUserSchemaData({ userId }) {
try {
const userSchemaFilePath = path.resolve(process.cwd(), `./jsonData/dbSchemas/users/user-${userId}/main.json`);
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;
}
} /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */
/***/ })
};
;