Skip to content

Commit

Permalink
User's gallery images correction
Browse files Browse the repository at this point in the history
  • Loading branch information
ArshiaSaleem98 committed Apr 5, 2020
1 parent 2f4c96b commit 6e92a75
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions AngularAnimalShelter/proxy.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"//*": {
"target": "https://localhost:8443/",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2>Gallery</h2>
<div class="container">
<div class="row">
<div id="imagebox" *ngFor="let ani of animal">
<img class="allimages" src="https://localhost:8443{{ani}}" alt="" height="100px" wight="100px">
<img class="allimages" src="{{src2}}{{ani}}" alt="" height="100px" wight="100px">

</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions AngularAnimalShelter/src/app/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export class ProfileComponent {
file: any[];
userGallery: string;
src=environment.apiBase2 + '/user';
src2=environment.apiBase3;


constructor(private service: ServiceService, private router: Router) {
this.user = JSON.parse(localStorage.getItem('currentUser'));
Expand Down
2 changes: 2 additions & 0 deletions AngularAnimalShelter/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ export const environment = {
production: true,
apiBase: "/api",
apiBase2:"/images",
apiBase3:"/",

};
1 change: 1 addition & 0 deletions AngularAnimalShelter/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const environment = {
production: false,
apiBase: "/api",
apiBase2:"/images",
apiBase3:"/"
};

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ public ResponseEntity<Object> getUserImage(@PathVariable long id) throws Malform
}
}

@PostMapping("/galleries")//to post UserPhoto by postman
@PostMapping("/galleries")//to post UserPhoto by postman
@ResponseStatus(HttpStatus.CREATED)
public List<String> setUserGallery(@RequestParam(value="userGallery", required=false) MultipartFile userGallery) throws IOException {
System.out.print("holai");
WebUser webuser= (WebUser) loggeduser.getLoggedUser();
service.save(webuser);
imageService.saveUserGalleryImage("users", userGallery);
String photo = "/images/users/" + userGallery.getOriginalFilename();
String photo = "images/users/" + userGallery.getOriginalFilename();
UserGalleryPhoto gp = new UserGalleryPhoto(photo);
servicegallery.save(gp);
gp.setGalleryOwner(webuser);
Expand All @@ -165,6 +165,7 @@ public List<String> setUserGallery(@RequestParam(value="userGallery", required=f
return gallery;
}


@GetMapping("/galleries")
public ResponseEntity<List<String>> getuserGallery() {

Expand Down

0 comments on commit 6e92a75

Please sign in to comment.