mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Add owners to groups.
This commit is contained in:
parent
3e7d91cb91
commit
37303c5d92
8 changed files with 98 additions and 70 deletions
|
@ -46,6 +46,7 @@ dbapi.saveDevice = function(serial, device) {
|
|||
serial: serial
|
||||
, present: true
|
||||
, provider: device.provider
|
||||
, owner: null
|
||||
, status: device.status
|
||||
, statusChangedAt: r.now()
|
||||
, createdAt: r.now()
|
||||
|
@ -65,6 +66,18 @@ dbapi.saveDeviceStatus = function(serial, status) {
|
|||
})
|
||||
}
|
||||
|
||||
dbapi.setDeviceOwner = function(serial, owner) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
owner: owner
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.unsetDeviceOwner = function(serial, owner) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
owner: null
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceAbsent = function(serial) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
present: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue