209 похожих чатов

Ребят, подскажите пожалуйста как рпавильно залидировать параметры era и nodeKey

в GET запросе? Хочу чтобы были проверки у era на обязательности и на IsNumber и у nodeKey на IsString

5 ответов

6 просмотров
Anton-Mazhuto Автор вопроса

я знаю, что когда один параметр в гет запросе то делают вот так(см скрин), а как валидировать если параметров больше одного?

Я новичок в несте, так что поправьте, пожалуйста, если сказал что-то не то. Мне кажется, что нужно написать dto(здесь использовать class-validator) и использовать validation pipe.

Anton-Mazhuto Автор вопроса
Andrey
Я новичок в несте, так что поправьте, пожалуйста, ...

Я так пробовал, но это не сработало . Так как у меня же два параметра. И их нужно указывать отдельно

также как в примере доки указаны надо делать, просто у тебя в отличии от доки нет дтошки и ты явно внутри декоратара указываешь как значения парсить из объекта params. Сделай как в доке и потом из объекта params вытащи деструктуризацией объекта нужные ключи

Anton-Mazhuto Автор вопроса

Похожие вопросы

Обсуждают сегодня

Conversation at a festival with a non-crpto person (not a normie by any stretch, though): * person: tell me about crypto, me: ok, the original idea is p2p sound money for the...
molecular#123 🐓
24
I bought some PHA tokens on Kucoin, which is the best wallet to store and easy to use?
AMR
19
But belive Kraken was like a few days with bank transfer and 1% or so? Obv your best option, no reason to fomo. You need to get any crypto first, then you can swap it for xmr
High CheeӃs
15
anyways, anybody know an OPEN SOURCE bitcoincash wallet for android that doesn't take 15 minutes to sync everytime i open it? (looking at you ElectronCash) i really liked Bitc...
Senko-san
22
How did we have so many dormant scammers in here? Who are these people. It’s been years. We know each other. If you dm me “I’ve been an og” but haven’t said a single word her...
Justin | LGCY |
49
@MikeHerron https://x.com/arkadefun/status/1805377234674630997?s=46 #NewKadena at its finest There will be totally nobody building on $KDA, i would like to know how you wa...
Archangel Kašperko
13
https://youtu.be/ZrornPDSv-8?si=8hYkt775_US7rtzi "This is one of sergeys great interviews; The interviewer deserves some credit here too, even though she's a f*male. She ask...
M
4
Why lovely inu substitute is not given till now? My lovely inu@Rs 70,000 goes to zero value.
Mohd Fakharuddin
12
Hello Everyone 🙌🏻💜 Happy (?) Friday to everyone 😁😁 I have read through all the comments/feedback/complaints in the last 2 days following the CEO Update AMA. Clearly the ...
Patrick - Ultra.io
5
Is UNIBRIGHT (UBT) Still A Good Investment in 2024? The Truth.. https://youtu.be/Uq9AuEmJ7B4
Ryan Rotolo (Crypto Fiend)
17
Карта сайта