feat: Adds ability to toggle an employee's active status (#3)

Reviewed-on: #3
This commit is contained in:
2025-01-28 17:27:00 +00:00
parent 027c7037a6
commit a76d523541
7 changed files with 54 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ struct ViewControllerTests {
@Test
func employeeViews() async throws {
try await withSnapshotTesting(record: record) {
try await withSnapshotTesting(record: .missing) {
try await withDependencies {
$0.viewController = .liveValue
$0.database.employees = .mock

View File

@@ -8,9 +8,15 @@
<div class="col-2"></div>
<input type="text" class="col-5" name="lastName" value="McTestface" placeholder="Last Name" required>
</div>
<div class="row" style="margin: 20px; float: left;">
<label for="active" style="margin-right: 15px;">
<h2>Active</h2></label>
<input type="checkbox" id="active" name="active" checked>
</div>
<div class="btn-row">
<button type="submit" class="btn-primary">Update</button>
<button class="danger" hx-confirm="Are you sure you want to delete this employee?" hx-delete="/api/v1/employees/00000000-0000-0000-0000-000000000000" hx-target="#employee-00000000-0000-0000-0000-000000000000" hx-swap="outerHTML transition:true swap:1s">Delete</button>
</div>
</form>
<h3><i><span class="primary" style="padding-right: 15px;">Note:</span><span class="secondary">It is better to mark an employee as in-active instead of deleting them.</span></i></h3>
</div>