Skip to content

Commit

Permalink
Merge branch 'v6.16' of github.com:WickrInc/wickrio_web_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pwcushman committed Jul 10, 2023
2 parents 30c7452 + a4f41e3 commit e511f79
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions web_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,33 @@ async function main() {
app.route([xapiEndpoint + "/Rooms", endpoint + "/Rooms"]).get(function (req, res) {
res.set("Content-Type", "application/json")
var vGroupID = req.params.vGroupID
try {
var cgr = WickrIOAPI.cmdGetRoom(vGroupID)
res.send(cgr)
} catch (err) {
console.log(err)
res.statusCode = 400
res.type("txt").send(err.toString())
if (vGroupID === undefined) {
try {
var cgr = WickrIOAPI.cmdGetRooms()
res.type("json").send(cgr)
} catch (err) {
console.log(err)
res.statusCode = 400
res.type("txt").send(err.toString())
}
} else {
try {
var cgr = WickrIOAPI.cmdGetRoom(vGroupID)
res.send(cgr)
} catch (err) {
console.log(err)
res.statusCode = 400
res.type("txt").send(err.toString())
}
}
})

app.route([xapiEndpoint + "/Rooms", endpoint + "/Rooms"]).get(function (req, res) {
app.route([xapiEndpoint + "/Rooms/:vGroupID", endpoint + "/Rooms/:vGroupID"]).get(function (req, res) {
res.set("Content-Type", "application/json")
var vGroupID = req.params.vGroupID
try {
var cgr = WickrIOAPI.cmdGetRooms()
res.type("json").send(cgr)
var cgr = WickrIOAPI.cmdGetRoom(vGroupID)
res.send(cgr)
} catch (err) {
console.log(err)
res.statusCode = 400
Expand Down

0 comments on commit e511f79

Please sign in to comment.