Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize frontend list operation response #153

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading