stacker.news/api/resolvers
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
..
admin.js snl live banner 2023-06-20 09:57:06 -05:00
blockHeight.js Add block height to price carousel (#484) 2023-09-12 10:56:02 -05:00
chainFee.js Add chain fees to price carousel (#658) 2023-12-20 16:06:22 -06:00
growth.js Monthly rewards (#890) 2024-03-01 10:28:55 -06:00
image.js Fix image fees undefined and not enforced if logged in (#909) 2024-03-13 16:08:55 -05:00
index.js Add chain fees to price carousel (#658) 2023-12-20 16:06:22 -06:00
invite.js upgrade to prisma 4 2023-07-26 19:18:42 -05:00
item.js Put all Web Push code into lib/webPush.js (#936) 2024-03-19 15:48:13 -05:00
lnurl.js gofac yourself 2023-12-14 11:30:51 -06:00
message.js Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"" 2023-07-23 10:08:43 -05:00
notifications.js Put all Web Push code into lib/webPush.js (#936) 2024-03-19 15:48:13 -05:00
ofac.js mute territories 2023-12-30 17:16:09 -06:00
price.js require sub selection, allow editting 2023-05-10 19:30:51 -05:00
referrals.js fix custom dates to use ms since epoch 2023-11-14 10:23:44 -06:00
rewards.js Monthly rewards (#890) 2024-03-01 10:28:55 -06:00
search.js Improved ux for domain only searches (#782) 2024-02-07 18:45:11 -06:00
serial.js refine serialization retries 2024-01-28 13:26:32 -06:00
sub.js Purchase archived territories (#897) 2024-03-19 17:23:59 -05:00
upload.js Image uploads (#576) 2023-11-06 14:53:33 -06:00
user.js API Keys (#915) 2024-03-14 15:32:34 -05:00
wallet.js handle other possible base64-like string encodings 2024-02-18 15:08:55 -06:00