bugs fixed
This commit is contained in:
1 parent
d77bb807ea
commit
0940f968e6
2 files changed
+30
-13
No files matched your search
+25
-8
@@ -325,8 +325,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Node-Schema -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> WEB3s -> Save-Node-Schema -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> WEB3s -> Save-Node-Schema -> Params Received = ' + body)
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Node-Schema -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Node-Schema -> Params Received = ' + body)
|
||||
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
@@ -347,11 +347,28 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
let project = requestParameters[3]
|
||||
const fs = require('fs')
|
||||
|
||||
console.log('docsSchema', docsSchema)
|
||||
console.log('project', project)
|
||||
|
||||
for (let i = 0; i < docsSchema.length; i++) {
|
||||
let schemaDocument = docsSchema[i]
|
||||
let fileContent = JSON.stringify(schemaDocument)
|
||||
let fileName = schemaDocument.type.toLowerCase().replaceAll(' ', '-') + '.json'
|
||||
|
||||
console.log('schemaDocument', schemaDocument)
|
||||
console.log('fileContent', fileContent)
|
||||
console.log('schemaDocument.type', schemaDocument.type)
|
||||
console.log('schemaDocument.type.toLowerCase()', schemaDocument.type.toLowerCase())
|
||||
|
||||
let fileName = schemaDocument.type.toLowerCase()
|
||||
for (let j = 0; j < 10; j++) {
|
||||
fileName = fileName.replaceAll(' ', '-')
|
||||
}
|
||||
fileName = fileName + '.json'
|
||||
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Concepts'
|
||||
|
||||
|
||||
console.log('fileName', filename)
|
||||
console.log('filePath', filePath)
|
||||
fs.writeFileSync(filePath + '/' + fileName, fileContent)
|
||||
}
|
||||
|
||||
@@ -359,8 +376,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Concept-Schema -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> WEB3s -> Save-Concept-Schema -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> WEB3s -> Save-Concept-Schema -> Params Received = ' + body)
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Concept-Schema -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Concept-Schema -> Params Received = ' + body)
|
||||
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
@@ -390,11 +407,11 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
}
|
||||
|
||||
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
|
||||
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Topic-Schema -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> WEB3s -> Save-Topic-Schema -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> WEB3s -> Save-Topic-Schema -> Params Received = ' + body)
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Topic-Schema -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Docs -> Save-Topic-Schema -> Params Received = ' + body)
|
||||
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
|
||||
@@ -1006,23 +1006,23 @@ function newSuperalgosDocSpace() {
|
||||
for (let j = 0; j < PROJECTS_ARRAY.length; j++) {
|
||||
let docsSchema
|
||||
let project = PROJECTS_ARRAY[j]
|
||||
|
||||
/*
|
||||
docsSchema = SCHEMAS_BY_PROJECT.get(project).array.docsNodeSchema
|
||||
httpRequest(JSON.stringify(docsSchema), 'Docs/Save-Node-Schema/' + project, onResponse)
|
||||
requestsSent++
|
||||
|
||||
*/
|
||||
docsSchema = SCHEMAS_BY_PROJECT.get(project).array.docsConceptSchema
|
||||
httpRequest(JSON.stringify(docsSchema), 'Docs/Save-Concept-Schema/' + project, onResponse)
|
||||
requestsSent++
|
||||
|
||||
/*
|
||||
docsSchema = SCHEMAS_BY_PROJECT.get(project).array.docsTopicSchema
|
||||
httpRequest(JSON.stringify(docsSchema), 'Docs/Save-Topic-Schema/' + project, onResponse)
|
||||
requestsSent++
|
||||
}
|
||||
*/ }
|
||||
|
||||
function onResponse(err, data) {
|
||||
/* Lets check the result of the call through the http interface */
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
okResponses++
|
||||
}
|
||||
responseCount++
|
||||
|
||||
Reference in new issue
Block a user