Skip to content

Feature/day 9 third party api aminah#9

Open
GreyyDaze wants to merge 24 commits intomasterfrom
feature/day-9-third-party-api-aminah
Open

Feature/day 9 third party api aminah#9
GreyyDaze wants to merge 24 commits intomasterfrom
feature/day-9-third-party-api-aminah

Conversation

@GreyyDaze
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread app/controllers/notes_controller.ts Outdated
const data = request.only(['title', 'content'])
const note = await Note.create(data)
const data = await request.validateUsing(NoteValidator)
await Note.create(data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error handling? you should show proper error message on frontend aswell

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve

Comment thread app/controllers/todos_controller.ts Outdated
* Handle form submission for the create action
*/
async store({ request, response, logger }: HttpContext) {
logger.info("todo post getting called")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add validation in each controller function, where required.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve

Comment thread app/controllers/todos_controller.ts Outdated
* Handle form submission for the edit action
*/
async update({ params, request, response, logger }: HttpContext) {
const todo = await Todo.findByOrFail('id', params.id);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve

Comment thread app/controllers/weather_controller.ts Outdated
let lon = request.input('lon')

if (!lat || !lon) {
const ipInfo = await axios.get('https://ipwho.is/')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this url in the env

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve

Comment thread app/controllers/weather_controller.ts Outdated
lon = ipInfo.data.longitude
}

const weatherData = await WeatherService.getWeather(lat, lon)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen this api throw an error or return 404 response?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve

@GreyyDaze GreyyDaze requested a review from hassan-qureshi1 May 3, 2025 11:46
@UzairAhmedDahraj UzairAhmedDahraj force-pushed the feature/day-9-third-party-api-aminah branch from 780fe15 to ecd4175 Compare February 15, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants