Age | Commit message (Collapse) | Author |
|
|
|
Backend REST Service implementation
|
|
|
|
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
addPage() {
//Code here to move to add page
}
submitSearch() {
//Code here to submit search
}
shoppingCart() {
//Code here to move to shopping cart
}
}
Updated main page to include just the top navigation
|
|
card component the new main page. Left main page component in so that
the original code is there, as well as the general outline for the
other pages. Recipes still need to be loaded in from the backend, as
they are currently pre-loaded. Also needs to be connected so the add,
shopping cart, edit, and delete commands perform the correct tasks.
|
|
|
|
of these components for html, css, ts, and spec.ts. HTML and CSS files
were updated with code from stackblitz. Apparently this thing also
thinks I changed the app.module.ts file, but I do not think I did.
|
|
|
|
|
|
|
|
`Access-Control-Allow-Methods` & `Access-Control-Allow-Headers` headers
are needed to make POST requests from angular.
|
|
|
|
|
|
Mostly variable name fixes and type fixes.
Also delete unused DataModels
|
|
BackendService was created as BackendServiceService. This was renamed in
all other files but not in backend.service.spec.ts.
|
|
|
|
|
|
Api json and recipe object
|
|
|
|
The index of the array can be used instead.
|
|
Elim
|
|
|
|
Backend improvement (Refactoring)
|
|
|
|
|
|
|
|
|
|
Content-Type header was not included in response because WriteHeader()
was called before setting Content-Type.
|
|
|
|
Replace response setup/send code w/ calls to sendResponse()
|
|
sendResponse function implements creating and sending a APIRespones so
that this code will not be rewritten for every response situation i.e.
the different http methods.
|
|
Now panics when can't connect to database and splits handling of errors
from Open() and Ping() as separate issues.
|
|
Moves default case (Method Not Allowed) into else clause so it is not
necessary to return from the previous if's --- only for checking http
method, error checking if statements can/should be returning where
needed.
|
|
Access-Control-Allow-Origin:* header added to API responses to allow
angular to access API.
Note: This allows all domains to access this API through browser javascript
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS> for a
description of CORS
|
|
|
|
|
|
|
|
Combines APIResponseItem and APIResponseList into one struct. Hopefully
this allows for the combination of some response code (a function
that sends a APIResponse that can be used by each http method)
|
|
Also adds error for POST to individual resource
|
|
|
|
Transactions allow us to rollback inserts ensuring that the database is
in sync with our application.
|
|
When updating ingredients if some # are remove we need to remove the
same number from the database and update the rest, without an id column
we don't know which ones to delete.
|
|
Changed database schema so ingredients & steps does not have an id, and
therefore can't return it so instead we just exec the insert statement
without returning anything.
We do have to check that there were affected rows in order to accurately
update the recipe object.
|
|
|
|
|
|
|
|
Now uses sql.QueryRow rather than sql.Query so it doesnt have to check
row.Next(), just have to check that row was returned (on scan call)
|
|
|
|
MakeRecipeFromId was creating a empty recipe because rows.Next() was not
being checked.
|
|
JSON is no longer output to stdout and actually sent to client
|