Compare commits

...

5 Commits

Author SHA1 Message Date
Keyan f5ebd573d6
Merge pull request #1499 from stackernews/fix-wallet-save
Fix wallet client validation
2024-10-19 20:22:22 -05:00
Keyan 5d5bc22e3d
Merge pull request #1502 from stackernews/fix-unarchive
Fix territory unarchive schema validation
2024-10-19 20:21:40 -05:00
ekzyis 50e153df7c Fix territory unarchive schema validation 2024-10-20 01:25:25 +02:00
ekzyis 1f9ab08228 Add comments 2024-10-19 22:36:26 +02:00
ekzyis 69c80e3d5c Fix wallet client validation 2024-10-19 22:33:37 +02:00
2 changed files with 6 additions and 2 deletions

View File

@ -260,7 +260,7 @@ export default {
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 } })
if (!oldSub) {

View File

@ -125,7 +125,8 @@ function extractConfig (fields, config, client) {
const field = fields.find(({ name }) => name === key)
// 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
if (!field || (client ? isClientField(field) : isServerField(field))) {
@ -198,6 +199,9 @@ function useConfig (wallet) {
if (transformedConfig) {
newClientConfig = Object.assign(newClientConfig, transformedConfig)
}
// these are stored on the server
delete newClientConfig.autoWithdrawMaxFeePercent
delete newClientConfig.autoWithdrawMaxFeeTotal
} catch {
valid = false
}