Compare commits
5 Commits
7aa0d8f430
...
f5ebd573d6
Author | SHA1 | Date | |
---|---|---|---|
|
f5ebd573d6 | ||
|
5d5bc22e3d | ||
|
50e153df7c | ||
|
1f9ab08228 | ||
|
69c80e3d5c |
@ -260,7 +260,7 @@ export default {
|
|||||||
|
|
||||||
const { name } = data
|
const { name } = data
|
||||||
|
|
||||||
await ssValidate(territorySchema, data, { models, me, sub: { name } })
|
await ssValidate(territorySchema, data, { models, me })
|
||||||
|
|
||||||
const oldSub = await models.sub.findUnique({ where: { name } })
|
const oldSub = await models.sub.findUnique({ where: { name } })
|
||||||
if (!oldSub) {
|
if (!oldSub) {
|
||||||
|
@ -125,7 +125,8 @@ function extractConfig (fields, config, client) {
|
|||||||
const field = fields.find(({ name }) => name === key)
|
const field = fields.find(({ name }) => name === key)
|
||||||
|
|
||||||
// filter server config which isn't specified as wallet fields
|
// filter server config which isn't specified as wallet fields
|
||||||
if (client && (key.startsWith('autoWithdraw') || key === 'id')) return acc
|
// (we allow autowithdraw members to pass validation)
|
||||||
|
if (client && key === 'id') return acc
|
||||||
|
|
||||||
// field might not exist because config.enabled doesn't map to a wallet field
|
// field might not exist because config.enabled doesn't map to a wallet field
|
||||||
if (!field || (client ? isClientField(field) : isServerField(field))) {
|
if (!field || (client ? isClientField(field) : isServerField(field))) {
|
||||||
@ -198,6 +199,9 @@ function useConfig (wallet) {
|
|||||||
if (transformedConfig) {
|
if (transformedConfig) {
|
||||||
newClientConfig = Object.assign(newClientConfig, transformedConfig)
|
newClientConfig = Object.assign(newClientConfig, transformedConfig)
|
||||||
}
|
}
|
||||||
|
// these are stored on the server
|
||||||
|
delete newClientConfig.autoWithdrawMaxFeePercent
|
||||||
|
delete newClientConfig.autoWithdrawMaxFeeTotal
|
||||||
} catch {
|
} catch {
|
||||||
valid = false
|
valid = false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user