nkowaokwu / igbo_api

An API exposing Igbo words, definitions, and more
https://igboapi.com
Apache License 2.0
316 stars 141 forks source link

Return Response Once If No Term Is Provided for Json data search #238

Closed pappyJ closed 3 years ago

pappyJ commented 4 years ago

No return keyword is specified when sending the 'NO TERM PROVIDED' response therefore after sending it ... Code continues to run ... And once it hits the next res statement .. Logs ERR_HTTP_HEADERS_SENT error to the console

Screenshot from 2020-11-10 03-30-38 Screenshot from 2020-11-10 03-29-47 Screenshot from 2020-11-10 03-30-16

ijemmao commented 4 years ago

@pappyJ Can you please provide a textual description to make this thread more accessible?

pappyJ commented 4 years ago

🙄🙄🙄 guidelines please

ijemmao commented 4 years ago

@pappyJ A good rule of thumb is to never just add images since there might be a chance that someone who can't see or just render images in their browser can still be apart of the conversation.

On top of that, adding text makes it a lot clearer what the intent of the author is. It provides a lot of helpful context for disuccsions.

With that being said, I think the solution to this problem is to change the line res.send(NO_PROVIDED_TERM) to return res.send(NO_PROVIDED_TERM) so it doesn't reach the second res.

pappyJ commented 4 years ago

Exactly ma ...

On Wed, Nov 11, 2020, 5:25 PM Ijemma Onwuzulike notifications@github.com wrote:

Assigned #238 https://github.com/ijemmao/igbo_api/issues/238 to @pappyJ https://github.com/pappyJ.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ijemmao/igbo_api/issues/238#event-3984620954, or unsubscribe https://github.com/notifications/unsubscribe-auth/APW5Z4FMK24XLR47ENYIHB3SPK3HPANCNFSM4TQC67PQ .