Skip to content

Add flight map for airplane models#67

Open
Bohaska wants to merge 6 commits intomyflyclub:masterfrom
Bohaska:patch-14
Open

Add flight map for airplane models#67
Bohaska wants to merge 6 commits intomyflyclub:masterfrom
Bohaska:patch-14

Conversation

@Bohaska
Copy link
Copy Markdown

@Bohaska Bohaska commented Jul 2, 2024

Adds a flight map where you can view all flights that use a certain airplane model.

Note: I have not tested this. (and can't test the backend stuff)

}

def getLinksByAirplaneModel(modelId : Int) = Action {
val linksByModel = LinkSource.loadFlightLinksByAirplaneModel(airportId).groupBy(_.from)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Bohaska the airportId here is not defined. Meanwhile the modelId is not being used.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I reused some code from the airport flight map function and forgot to change some of the parameters...

Yea, swap airportId with modelId

def getLinksByAirplaneModel(modelId : Int) = Action {
val linksByModel = LinkSource.loadFlightLinksByAirplaneModel(airportId).groupBy(_.from)

val sortedLinks: Map[List[Airport], List[Link]] = links.foldLeft(Map.empty[List[Airport], List[Link]]) { (map, link) =>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Bohaska the links should probably be linksByModel ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, this is also a bug

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