Skip to content

Commit ad89550

Browse files
authored
Merge pull request #394 from justin-luoma/patch-1
fix: prevent posting duplicate records
2 parents 23a41ea + 0da8183 commit ad89550

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

course-02/exercises/udacity-c2-frontend/src/app/api/api.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class ApiService {
6363

6464
return new Promise ( resolve => {
6565
this.http.request(req).subscribe((resp) => {
66-
if (resp && (<any> resp).status && (<any> resp).status === 200) {
66+
if (resp && resp.type === HttpEventType.Response && (<any> resp).status && (<any> resp).status === 200) {
6767
resolve(this.post(endpoint, payload));
6868
}
6969
});

0 commit comments

Comments
 (0)