Skip to content

Commit

Permalink
optimize frontend list operation response (#153)
Browse files Browse the repository at this point in the history
* optimize frontend list operation response

* fix ci
  • Loading branch information
QSummerY authored Sep 5, 2023
1 parent 9b77360 commit 6c73a8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/pages/ticket/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<a-tag :key="status" :color="approval_color[status]">{{status}}</a-tag>
</span>
<span slot="action" slot-scope="text, record">
<span v-if="record.is_approved === undefined && record.status !== 'closed' ">
<span v-if="record.status === 'pending' ">
<a-modal v-model="rejectModalVisible" title="Reject reason" ok-text="confirm" cancel-text="cancel" @ok="onConfirm(record, 'rejected', reasonModalRecord.reject_url)" @cancel="hideRejectModal">
<a-input v-model="rejectReason" placeholder="Reject reason" max-length=128 />
</a-modal>
Expand All @@ -65,7 +65,7 @@
<a-divider type="vertical" />
</span>

<span v-if="record.is_approved === undefined && record.status !== 'closed' && record.submitter === $store.state.userProfile.name">
<span v-if="record.status === 'pending' && record.submitter === $store.state.userProfile.name">
<a-modal v-model="closeModalVisible" title="Close reason" ok-text="confirm" cancel-text="cancel" @ok="onConfirm(record, 'closed', '/api/ticket/' + record.id + '/close')" @cancel="hideCloseModal">
<a-input v-model="closeReason" placeholder="Close reason" max-length=128 />
</a-modal>
Expand Down Expand Up @@ -342,6 +342,7 @@ export default {
this.$message.info('Ticket ' + status)
this.hideRejectModal()
this.hideCloseModal()
this.loadTickets({page: 1, pagesize: 10})
}).catch((error) => {
const rawMsg = error.response.data.description
const msg = rawMsg.length > 300 ? rawMsg.slice(0, 300) + '... ' : rawMsg
Expand Down
2 changes: 1 addition & 1 deletion helpdesk/views/api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def index():


@router.get('/user/me')
async def user(current_user: User = Depends(get_current_user)) -> dict:
async def user(current_user: User = Depends(get_current_user)):
return current_user


Expand Down

0 comments on commit 6c73a8d

Please sign in to comment.