Conversation
* add postgre to DeployToCloud * update AddWebApplication for postgre * add complete message to stencil * first draft README update * Update RetrievingAndDeleting for postgres * added summary to meal * Fixed bugs in tutorials
README.md
Outdated
-H 'content-type: application/json' | ||
``` | ||
This should now return an array containing the Meals that was stored by the POST request. As this contains the full images stored in the Meal objects, this will involve several screens of data! | ||
This should now return an array containing the meals names and ratings stored by the POST request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be spelled meals' names and ratings
README.md
Outdated
``` | ||
below the line `.package(url: | ||
"https://github.com/IBM-Swift/Health.git", from: "0.0.0"),` | ||
below the line `.package(url: "https://github.com/IBM-Swift/Health.git", from: "0.0.0"),` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are finding out right now, this should be specifying at least version 1.0.0
StencilFrontend.md
Outdated
@@ -330,7 +334,7 @@ router.post("/foodtracker") { request, response, next in | |||
} | |||
``` | |||
|
|||
Restart your server to add your new changes. When you add a new meal at [http://localhost:8080/foodtracker](http://localhost:8080/foodtracker), you should see the webpage update with your new meal. | |||
Restart your server to add your new changes. When you add a new meal at [http://localhost:8080/foodtracker](http://localhost:8080/foodtracker), you should see the webpage update with your new meal. Since the requests are Asyc, you may need to refresh the webpage to see the new meal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be Since the requests are async...
StencilFrontend.md
Outdated
@@ -150,8 +150,12 @@ router.get("/foodtracker") { request, response, next in | |||
``` | |||
We can test this route by running the FoodTracker application and the FoodServer. Add a meal in the app and then go to [http://localhost:8080/foodtracker](http://localhost:8080/foodtracker). This will now display a line saying how many meals are present in the app and a list of the meal names and ratings. | |||
|
|||
### Congratulations, you have successfully served a dynamic HTML webpage! | |||
The next sections will take you through saving and displaying the meal photograph, receiving new meals from a web form and adding css to the webpage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS should be all caps.
RetrievingAndDeleting.md
Outdated
|
||
2. The following code can be used in the FoodTracker app to make the call to the FoodServer. Here the Meal name is used for the Identifier. | ||
3. The following function is added to the FoodTracker > MealTableViewController to make the delete call to the FoodServer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just specify the filename here, like MealTableViewController.swift
instead of the hierarchy you used here.
RetrievingAndDeleting.md
Outdated
|
||
2. The following code can be used in the FoodTracker app to make the call to the FoodServer. Here the Meal name is used for the Identifier. | ||
3. The following function is added to the FoodTracker > MealTableViewController to make the delete call to the FoodServer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, delete
should be in all caps here to specify the RESTful call being made.
RetrievingAndDeleting.md
Outdated
```swift | ||
do { | ||
let data = try PropertyListEncoder().encode(meals) | ||
let isSuccessfulSave = NSKeyedArchiver.archiveRootObject(data, toFile: MealTableViewController.ArchiveURL.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now, but perhaps setting up Core Data, or even using something like Realm, might be better in the future 😄 just for the sake of "best practices" on the iOS side. This is an old school way of doing it.
RetrievingAndDeleting.md
Outdated
The following code can be added to the FoodTracker app and will query the saved Meals from the server, and update the TableView: | ||
1. Open the FoodTracker workspace | ||
`open ~/FoodTrackerBackend/iOS/FoodTracker/FoodTracker.xcworkspace/` | ||
2. In FoodTracker > MealTableViewController.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is incomplete. Maybe 2 and 3 need to be merged together?
README.md
Outdated
func summaryHandler(completion: @escaping ([Summary]?, RequestError?) -> Void ) { | ||
Meal.findAll { meals, error in | ||
if let meals = meals { | ||
completion(Summary(meals), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't have error handling, and will hang forever if meals
doesn't resolve properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
LGTM. Merging. |
* Add Persistence Tutorial (#14) * Add Database tutorial * linked to CompletedFoodTracker * fixed missing bracket * Fixed missing space * removed no requisites * remove -> void * no festive :( * update README * README review * feat: Add ORM with PostgreSQL steps (#18) * Meal.swift file no longer changed (#20) * Updated to keep model object same * Minor edits * One word change * Added Tutorial for Stencil Templating (#16) * add Stencil Tutorial * fixing typos * Little fixes * added Form Submission * Stencil updates * fixed new lines * kye review * Editing updates to StencilFrontend tutorial * implemented Helens changes * remove w3 css * made new Example.stencil * update readme * Fixed README for Web and ORM (#22) * Updated to keep model object same * Minor edits * One word change * Updated web templating front end to use ORM functionality * Removed configuration target when adding ORM * Changes suggested by @ianpartridge * One last minor change * Updated per @Andrew-Lees11 comments * Update food tracker backend (#27) * Update Foodtracker tutorial * update targets * Fix next steps (#1) (#28) * Fix next steps (#1) * add postgre to DeployToCloud * update AddWebApplication for postgre * add complete message to stencil * first draft README update * Update RetrievingAndDeleting for postgres * added summary to meal * Fixed bugs in tutorials * implemented Davids review * Remove build warnings in xcode Swift 4.1 (#31) * Fix numbers (#32) * fix: numbering in README * fix: add full stop * feat: Update Swift-Kuery-ORM version (#33) * Complete FoodTracker tutorial * linked Auth in next steps * update to Kitura 2.5 * added basc authentication steps * removed database next step
These changes Update:
AddWebApplication.md
DeployToCloud.md
RetrievingAndDeleting.md
To work with the updated FoodTracker README with PostgreSQL.
It also has changes to the README to add a Summary route which only displays the meal name and rating so users can see the meals without the pages of photo data.
Finally there are some minor text changes for clarity.