Skip to content

Commit 602c31d

Browse files
committed
Fix mobile, small tweaks and fixes
1 parent 63f1931 commit 602c31d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+880
-3342
lines changed

jobhunt/Configuration/SearchOptions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ namespace JobHunt.Configuration {
22
public class SearchOptions {
33
public const string Position = "Search";
44
public string IndeedPublisherId { get; set; } = null!;
5-
public string IndeedHostName { get; set; } = "indeed.com";
65
public bool IndeedFetchSalary { get; set; }
76
public string GlassdoorPartnerId { get; set; } = null!;
87
public string GlassdoorPartnerKey { get; set; } = null!;

jobhunt/Controllers/JobsController.cs

+11
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,16 @@ public async Task<IActionResult> Categories() {
141141
Name = c.Name
142142
}));
143143
}
144+
145+
[HttpPatch("{id}")]
146+
public async Task<IActionResult> Status([FromRoute]int id, [FromBody]string status) {
147+
bool result = await _jobService.UpdateStatusAsync(id, status);
148+
149+
if (!result) {
150+
return NotFound();
151+
} else {
152+
return Ok();
153+
}
154+
}
144155
}
145156
}

jobhunt/Controllers/SearchDebugController.cs

-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
using System.Threading.Tasks;
44

55
using Microsoft.AspNetCore.Mvc;
6-
using Microsoft.AspNetCore.WebUtilities;
7-
using Microsoft.Extensions.Options;
86

9-
using JobHunt.Configuration;
10-
using JobHunt.Models;
117
using JobHunt.Searching;
128
namespace JobHunt.Controllers {
139
[ApiController]

jobhunt/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
22
WORKDIR /app
33

4-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
5-
RUN apt-get install -y nodejs unzip
4+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
5+
RUN apt-get install -y nodejs unzip ca-certificates
66

77
# Copy csproj and restore as distinct layers
88
COPY *.csproj ./
@@ -16,7 +16,7 @@ RUN dotnet publish -c Release -o out
1616
FROM mcr.microsoft.com/dotnet/aspnet:5.0
1717
WORKDIR /app
1818
RUN apt-get update
19-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
19+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
2020
RUN apt-get install -y nodejs unzip libfreetype6 libfontconfig1 ca-certificates
2121
COPY --from=build-env /app/out .
22-
ENTRYPOINT ["dotnet", "jobhunt.dll"]
22+
ENTRYPOINT ["dotnet", "JobHunt.dll"]

jobhunt/Dockerfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WORKDIR /app
33
RUN dotnet tool install -g dotnet-ef
44
ENV PATH "$PATH:/root/.dotnet/tools"
55

6-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
6+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
77
RUN apt-get update
88
RUN apt-get install -y --no-install-recommends nodejs unzip libfreetype6 libfontconfig1 ca-certificates procps
99
RUN curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l /vsdbg

jobhunt/Filters/ExceptionLogger.cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Net;
2+
using System.Threading.Tasks;
3+
4+
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.Mvc.Filters;
6+
using Microsoft.Extensions.Logging;
7+
8+
namespace JobHunt.Filters {
9+
public class ExceptionLogger : IAsyncExceptionFilter {
10+
private readonly ILogger _logger;
11+
public ExceptionLogger(ILogger<ExceptionLogger> logger) : base() {
12+
_logger = logger;
13+
}
14+
public Task OnExceptionAsync(ExceptionContext context) {
15+
_logger.LogError(context.Exception, "Exception caught by ExceptionLogger");
16+
17+
context.Result = new ContentResult { StatusCode = (int)HttpStatusCode.InternalServerError, Content = "JobHunt has encountered an error. Please try again or report an issue at https://github.com/jamerst/JobHunt/issues.", ContentType = "text/plain" };
18+
return Task.CompletedTask;
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)