Commit 8eb1aa8
sheeek
fix(files): handle different response formats in files list
- Handle dict, list[dict], and list[str] response formats
- Unwrap responses that might be in 'files' or 'data' keys
- Support both file_name and name fields
- Gracefully handle string-only responses
- More robust error handling for API inconsistencies
Tested with:
✅ files list --folder "Home"
✅ files list --attached-to "ToDo" "xxx"
Frappe API returns different formats depending on method used.1 parent 3233bfd commit 8eb1aa8
1 file changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
| |||
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
169 | 179 | | |
170 | 180 | | |
171 | 181 | | |
| |||
0 commit comments