Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paulr34 committed Jul 13, 2023
1 parent 246e6a1 commit 7385248
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
2 changes: 0 additions & 2 deletions src-electron/rest/file-ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ function httpPostFileOpen(db) {
ideProjectPath = dbEnum.sessionKey.ideProjectPath
zapFilePath = req.body.search?.split('filePath=')
zapFilePath = zapFilePath[1]?.replaceAll('%2F', '//').trim()
console.log('NOTICE ME!!!')
console.log(zapFilePath)
}

// let { ideProjectPath } = req.body
Expand Down
33 changes: 6 additions & 27 deletions src-electron/rest/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ function sessionAttempt(db) {
if (req.body.search?.includes('filePath=%2F')) {
let filePath = req.body.search.split('filePath=')
filePath = filePath[1].replaceAll('%2F', '//').trim()
console.log(filePath)
if (filePath.includes('.zap')) {
let data = await fsp.readFile(filePath)
console.log('ISCC!!!!')
let obj = JSON.parse(data)
let category = obj.package[0].category
let open = true
Expand All @@ -50,15 +48,12 @@ function sessionAttempt(db) {
dbEnum.packageType.zclProperties,
category
)
console.log(dbEnum.packageType.zclProperties)
const zclGenTemplates = await queryPackage.getPackagesByCategoryAndType(
db,
dbEnum.packageType.genTemplatesJson,
category
)
console.log(zclGenTemplates)
const sessions = await querySession.getDirtySessionsWithPackages(db)
console.log(sessions)
return res.send({
zclGenTemplates,
zclProperties,
Expand Down Expand Up @@ -104,6 +99,12 @@ function sessionAttempt(db) {
}
}
}
/**
* This function creates a new session with its packages according to selected Properties and Templates
* @param {*} db
* @param {*} options: object containing 'zcl' and 'template'
* @returns A success message.
*/

function sessionCreate(db) {
return async (req, res) => {
Expand All @@ -116,7 +117,6 @@ function sessionCreate(db) {
} else {
let zapUserId = req.session.zapUserId
let zapSessionId
console.log(req.session)
if (`zapSessionId` in req.session) {
zapSessionId = req.session.zapSessionId[sessionUuid]
} else {
Expand Down Expand Up @@ -158,27 +158,6 @@ function sessionCreate(db) {
}
}

/**
* This function creates a new session with its packages according to selected Properties and Templates
* @param {*} db
* @param {*} options: object containing 'zcl' and 'template'
* @returns A success message.
*/
function initializeSession(db) {
return async (req, res) => {
console.log(req.body.sessionId)
await util.ensurePackagesAndPopulateSessionOptions(
db,
req.body.sessionId,
{},
req.body.zclProperties,
req.body.genTemplate
)
return res.send({
message: 'Session created successfully',
})
}
}

/**
* This function reloads previous session by user selected session's id
Expand Down
4 changes: 0 additions & 4 deletions src-electron/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ async function ensurePackagesAndPopulateSessionOptions(
)
}
if (packageId != null) {
console.log('PACKAGEID-zcl')
console.log(packageId)
return queryPackage.insertSessionPackage(
db,
sessionId,
Expand Down Expand Up @@ -168,8 +166,6 @@ async function ensurePackagesAndPopulateSessionOptions(
}
}
if (packageId != null) {
console.log('PACKAGEID-gen')
console.log(packageId)
return queryPackage.insertSessionPackage(
db,
sessionId,
Expand Down

0 comments on commit 7385248

Please sign in to comment.