init
This commit is contained in:
@@ -30,7 +30,6 @@ The goal of this task is to add an "Add Server" button and creation functionalit
|
||||
- Cancel and Create buttons with loading state handling.
|
||||
- **Store Integration:** `useServerStore` must provide a `createServer` action that performs `POST /servers` with the appropriate payload (`{ name, password, is_default }`).
|
||||
|
||||
|
||||
# Technical Design
|
||||
|
||||
### Current Implementation
|
||||
@@ -80,7 +79,6 @@ graph LR
|
||||
ServerStore -->|Updates servers list| AppLayout
|
||||
```
|
||||
|
||||
|
||||
# Testing
|
||||
|
||||
### Validation Approach
|
||||
@@ -97,10 +95,9 @@ graph LR
|
||||
- **Validation Error:** Empty server name disables the create button or shows an alert.
|
||||
- **API Error Handling:** Catch and log API failures gracefully.
|
||||
|
||||
|
||||
# Delivery Steps
|
||||
|
||||
### Step 1: Extend server Pinia store with createServer action
|
||||
### * Step 1: Extend server Pinia store with createServer action
|
||||
Extend the server Pinia store with createServer action.
|
||||
- Update `frontend/src/stores/server.ts` to include `createServer(payload: { name: string; password?: string | null; is_default?: boolean })`.
|
||||
- Handle error states, API POST requests to `/servers`, and state updates to push the newly created server to `this.servers`.
|
||||
|
||||
Reference in New Issue
Block a user