stacker.news/api
ekzyis 687d71f246
Purchase archived territories (#897)
* Handle archived territories in territory form

* Use dedicated mutation

* Add sanity check for eternal territories

* Fix fields and cost ignored

* Remove no longer needed manual validation in upsertSub

* Remove founder check

* Always check if sub is archived

Using { abortEarly: false } now since previously, if no description was not given, we wouldn't detect if the sub was archived since validation would abort on empty descriptions.

Only on submission all fields would get validated but since we ignore archived errors during submission, the user would never see that the sub is archived before submission
+ the wrong mutation would run if archived is not already true before submission.

Hence, we need to validate all fields always.

There is currently still a bug where the validation does not immediately run but maybe this can be fixed by simply using validateImmediately on the Formik component.

* Fix archived warning not shown after first render

* Only create transfers if owner actually changes

* Reuse helper functions in lib/territory.js

* Rename var to editing

* Use onChange instead of validation override

* Run same validation on server for unarchiving

* Fix 'territory archived' shown during edits

* Use && instead of ternary operator for conditional query

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-03-19 17:23:59 -05:00
..
lnd Add docs for local LND setup 2023-05-19 18:28:46 -05:00
models refine module instantiation 2022-04-27 17:06:42 -05:00
resolvers Purchase archived territories (#897) 2024-03-19 17:23:59 -05:00
s3 add sndev shell script and enhance docker compose local dev 2024-03-13 09:04:09 -05:00
search semantic search 2024-01-15 17:22:57 -06:00
slack Add setting to send diagnostics back to SN (#463) 2023-09-18 18:00:16 -05:00
typeDefs Purchase archived territories (#897) 2024-03-19 17:23:59 -05:00
package.json Convert worker to ESM (#500) 2023-09-23 20:19:35 -05:00
ssrApollo.js Add chain fees to price carousel (#658) 2023-12-20 16:06:22 -06:00