update: cleaned up balance webhooks
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
processor?: object | null,
|
||||
processors?: object | null,
|
||||
auto_topups?: array | null,
|
||||
spend_limits?: array | null
|
||||
spend_limits?: array | null,
|
||||
usage_alerts?: array | null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,4 +112,13 @@ if updates.spend_limits ~= nil then
|
||||
table.insert(updated_fields, 'spend_limits')
|
||||
end
|
||||
|
||||
if updates.usage_alerts ~= nil then
|
||||
if is_nil(updates.usage_alerts) then
|
||||
redis.call('JSON.SET', cache_key, '$.usage_alerts', 'null')
|
||||
else
|
||||
redis.call('JSON.SET', cache_key, '$.usage_alerts', cjson.encode(updates.usage_alerts))
|
||||
end
|
||||
table.insert(updated_fields, 'usage_alerts')
|
||||
end
|
||||
|
||||
return cjson.encode({ success = true, updated_fields = updated_fields })
|
||||
|
||||
Reference in New Issue
Block a user