mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-17 23:53:25 +02:00
Add owners to groups.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user