You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1168b03
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: bruno/forms/deleteForm.bru
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ settings {
20
20
}
21
21
22
22
docs {
23
-
# Delete Form
23
+
# 5. Delete Form
24
24
25
25
Permanently removes a specific form. This endpoint ensures security by only allowing the **owner** of the form to delete it. If the form does not exist or belongs to another user, no action is taken, and a 404 error is returned.
Copy file name to clipboardExpand all lines: bruno/forms/getAllForms.bru
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ settings {
16
16
}
17
17
18
18
docs {
19
-
# Get All Forms
19
+
# 1. Get All Forms
20
20
21
21
Retrieves a list of all forms created by the currently authenticated user. This endpoint provides a summary view, returning key metadata like the title and publication status, but not the detailed form fields.
Copy file name to clipboardExpand all lines: bruno/forms/getFormById.bru
+24-54Lines changed: 24 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -20,75 +20,45 @@ settings {
20
20
}
21
21
22
22
docs {
23
-
# Get Form By ID
23
+
# 3. Get Form By ID
24
24
25
-
## Endpoint
26
-
`GET /forms/:formId`
25
+
Retrieves the details of a specific form. This endpoint is scoped to the **owner**, meaning a user can only fetch forms they created. If a form exists but belongs to another user, it will return a 404 error.
27
26
28
-
## Description
29
-
Fetches a form owned by the authenticated user along with its fields in order.
27
+
***URL:**`/forms/:formId`
28
+
***Method:**`GET`
29
+
***Auth Required:** Yes
30
30
31
-
## Controller
32
-
`getFormById`
31
+
### Path Parameters
33
32
34
-
## Auth Required
35
-
✅ Yes (User must be the form owner)
33
+
| Parameter | Type | Description |
34
+
| :--- | :--- | :--- |
35
+
|`formId`|`string` (UUID) | The unique ID of the form to retrieve. |
36
36
37
-
##Path Parameters
37
+
### Responses
38
38
39
-
| Name | Type | Required | Description |
40
-
|--------|--------|----------|-------------|
41
-
| formId | string | Yes | ID of the form |
39
+
#### ✅ 200 OK: Success
42
40
43
-
## Request Body
44
-
None
45
-
46
-
## Responses
47
-
48
-
### Success Response (Form with Fields)
49
-
50
-
#### Status: 200 OK
41
+
Returns the full form object.
51
42
52
43
```json
53
44
{
54
45
"success": true,
55
46
"message": "Form fetched successfully",
56
-
"form": {
57
-
"id": "form_456",
58
-
"title": "Job Application",
59
-
"description": "Apply for internship",
60
-
"isPublished": false,
61
-
"createdAt": "2026-02-07T10:30:00.000Z"
62
-
},
63
-
"fields": [
64
-
{
65
-
"id": "field_1",
66
-
"formId": "form_456",
67
-
"fieldName": "Full Name",
68
-
"fieldType": "text",
69
-
"prevFieldId": null
70
-
},
71
-
{
72
-
"id": "field_2",
73
-
"formId": "form_456",
74
-
"fieldName": "Email",
75
-
"fieldType": "email",
76
-
"prevFieldId": "field_1"
77
-
}
78
-
]
47
+
"data": {
48
+
"id": "form_uuid_123",
49
+
"title": "Customer Feedback Survey",
50
+
"description": "A survey to collect customer opinions.",
51
+
"isPublished": true,
52
+
"ownerId": "user_uuid_555",
53
+
"createdAt": "2023-10-27T10:00:00.000Z",
54
+
"updatedAt": "2023-10-27T12:00:00.000Z"
55
+
}
79
56
}
80
57
81
-
Success Response (No Fields Found)
82
-
Status: 200 OK
83
-
84
-
{
85
-
"success": true,
86
-
"message": "No forms fields found",
87
-
"data": []
88
-
}
58
+
❌ 404 Not Found
89
59
90
-
Error Responses
91
-
Status: 404 Not Found
60
+
Occurs if the formId does not exist OR if the form belongs to a different user.
0 commit comments