Added HTTP Method "patch" to CORS, fixed a bug that prevented shorthands to be shown.

This commit is contained in:
Sockenklaus
2021-10-31 01:11:31 +02:00
parent c81da2bbb5
commit 63c1407643
2 changed files with 4 additions and 2 deletions

View File

@@ -100,6 +100,7 @@ export default class EmployeesController {
result.employee.id = emp.id
result.employee.firstName = emp.firstName
result.employee.lastName = emp.lastName
result.employee.shorthand = emp.shorthand
result.employee.phone = emp.phone
result.employee.mobile = emp.mobile
result.employee.email = emp.email
@@ -118,6 +119,7 @@ export default class EmployeesController {
public async update ({params, bouncer, response, request}: HttpContextContract) {
const employee : Employee = await Employee.findOrFail(params.id)
const editContractHours : boolean = employee.contractHours !== request.input('contractHours')

View File

@@ -56,7 +56,7 @@ const corsConfig: CorsConfig = {
|
| Following is the list of default methods. Feel free to add more.
*/
methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'],
methods: ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE'],
/*
|--------------------------------------------------------------------------