An employee is only allowed to request up to 3 permits per month. If they need a fourth permit, they will have to wait until the following month.
Here is my table structure for permissions:
Permissions
id (integer),
format (text),
date_requested (date),
initial_date (date),
final_date (date),
employee_id (integer)
This is the code snippet defining the condition:
deactivate: 0,
var count = response.data.length;
if(count >= 3)
{
this.deactivate = 1;
}
else{
this.deactivate = 0;
}
I have added the following button with functionality to disable it when the limit of 3 permits is reached:
<button type="button" v-bind:disabled="deactivate == 1" @click="openModal(employee.id)" class="btn btn-primary float-sm-right">
<i class="fas fa-plus"></i> New
</button>
Currently, I can enforce the restriction on requesting more than 3 permits. However, I am looking for a solution to reset the limit every month. Any guidance on achieving this would be greatly appreciated.