fix: auto-fix findings from no-mistakes review
- Remove duplicate import - Fix → in create ticket - Fix → in ticket detail - Add note field to TicketUpdate schema and handle note-only updates in backend - Update frontend submitNote() to use PATCH endpoint
This commit is contained in:
@@ -311,7 +311,7 @@
|
||||
|
||||
async init() {
|
||||
await this.loadTicket();
|
||||
if (this.isFM || this.isAdmin) {
|
||||
if (app().isFM || app().isAdmin) {
|
||||
await this.loadTechnicians();
|
||||
}
|
||||
},
|
||||
@@ -392,9 +392,8 @@
|
||||
if (!this.noteForm.note.trim()) return;
|
||||
this.noteSubmitting = true;
|
||||
try {
|
||||
// Use status update endpoint to add a note without changing status
|
||||
const updated = await app().apiPost(`/api/tickets/${this.ticketId}/status`, {
|
||||
status: this.ticket.status,
|
||||
// Use PATCH endpoint which now supports note-only updates
|
||||
const updated = await app().apiPatch(`/api/tickets/${this.ticketId}`, {
|
||||
note: this.noteForm.note
|
||||
});
|
||||
this.ticket = updated;
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
const payload = {
|
||||
description: this.form.description,
|
||||
priority: this.form.priority || null,
|
||||
reporter: this.form.reporter || this.user.full_name,
|
||||
reporter: this.form.reporter || app().user.full_name,
|
||||
reported_via: this.form.reported_via || 'walk-in',
|
||||
category_id: this.form.category_id ? parseInt(this.form.category_id) : (this.form.category_main ? parseInt(this.form.category_main) : null),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user