Skip to content

Commit

Permalink
Fix pathing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Nov 10, 2023
1 parent 2c16df5 commit 6ad0052
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions TalentBlazor/Configure.Db.Talent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,16 @@ public static void SeedTalent(this IDbConnection db, AppHost appHost, string pro
}
}

public static void SeedAttachments(this IDbConnection db, ServiceStackHost appHost, string sourceDir)
public static void SeedAttachments(this IDbConnection db, string sourceDir, string targetDir)
{
sourceDir.AssertDir();
var resumeFileInfo = new FileInfo(Path.Join(sourceDir, "sample_resume.pdf"));
var coverFileInfo = new FileInfo(Path.Join(sourceDir, "sample_coverletter.pdf"));

var jobApps = db.LoadSelect<JobApplication>();
foreach (var jobApp in jobApps)
{
db.Save(sourceDir.CreatePdfAttachment(jobApp, resumeFileInfo));
db.Save(sourceDir.CreatePdfAttachment(jobApp, coverFileInfo));
db.Save(targetDir.CreatePdfAttachment(jobApp, resumeFileInfo));
db.Save(targetDir.CreatePdfAttachment(jobApp, coverFileInfo));
}
}

Expand Down
2 changes: 1 addition & 1 deletion TalentBlazor/Migrations/Migration1000.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public override void Up()
? "~/wwwroot/profiles".MapProjectPath()
: Path.Join(AppContext.BaseDirectory, "wwwroot", "profiles");
Db.SeedTalent(appHost,profilesDir);
Db.SeedAttachments(appHost, appHost.ContentRootDirectory.RealPath.CombineWith("Migrations", "seed"));
Db.SeedAttachments(appHost.ContentRootDirectory.RealPath.CombineWith("Migrations", "seed"),appHost.ContentRootDirectory.RealPath.CombineWith("App_Data"));
}

public void CreateBooking(IDbConnection? db,
Expand Down
2 changes: 1 addition & 1 deletion TalentBlazor/wwwroot/css/app.css

Large diffs are not rendered by default.

0 comments on commit 6ad0052

Please sign in to comment.