Added PodcastViewModel to entry VM

This commit is contained in:
Fergal Moran
2018-05-12 14:14:03 +01:00
parent 19c5c3ae3c
commit 4b6918a294
5 changed files with 16 additions and 2 deletions

View File

@@ -28,6 +28,10 @@ export class SideOverlayComponent implements OnInit {
if (r) {
this.user$ = this._profileService.getProfile();
this.entries$ = this._podcastService.getAllEntriesForUser();
this.entries$.subscribe((r) =>
console.log('side-overlay.component', 'gotEntries', r)
);
}
});
}

3
docker/letsencrypt.sh Normal file → Executable file
View File

@@ -1,4 +1,6 @@
#!/bin/bash
eval $(docker-machine env --unset)
read -n1 -p "Renew web? [y,n]" web
if [[ $web == "Y" || $web == "y" ]]; then
docker run -it --rm -p 443:443 -p 80:80 --name certbot \
@@ -52,4 +54,5 @@ if [[ $jobs == "Y" || $jobs == "y" ]]; then
-d jobs.podnoms.com \
-m fergal.moran@gmail.com
fi
eval $(docker-machine env --unset)
echo \n

View File

@@ -17,6 +17,6 @@ namespace PodNoms.Api.Models.ViewModels {
public bool Processed { get; set; }
public string ProcessingPayload { get; set; }
public int PodcastId { get; set; }
// public PodcastViewModel Podcast { get; set; }
public PodcastViewModel Podcast { get; set; }
}
}

View File

@@ -28,19 +28,23 @@ namespace PodNoms.Api.Persistence {
public async Task<IEnumerable<PodcastEntry>> GetAllForSlugAsync(string podcastSlug) {
var entries = await GetAll()
.Where(e => e.Podcast.Slug == podcastSlug)
.Include(e => e.Podcast)
.ToListAsync();
return entries;
}
public async Task<IEnumerable<PodcastEntry>> GetAllForUserAsync(string userId) {
var entries = await GetAll()
.Where(e => e.Podcast.AppUser.Id == userId)
.Include(e => e.Podcast)
.ToListAsync();
return entries;
}
public async Task<PodcastEntry> GetByUidAsync(string uid) {
var entry = await GetAll()
.SingleOrDefaultAsync(e => e.NewId.ToString().Equals(uid));
.Include(e => e.Podcast)
.SingleOrDefaultAsync(e => e.NewId.ToString().Equals(uid))
;
return entry;
}

View File

@@ -35,6 +35,9 @@ namespace PodNoms.Api.Providers {
.ForMember(
src => src.PodcastId,
e => e.MapFrom(m => m.Podcast.Id))
.ForMember(
src => src.Podcast,
e => e.MapFrom(m => m.Podcast))
.ForMember(
src => src.Uid,
e => e.MapFrom(m => m.ExposedUid));