Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
feat: implement real agree and refuse application
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazyokd committed Mar 22, 2023
1 parent 0d2fa57 commit 655c846
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/components/NavigationZone/ApplicationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
</template>

<script>
import axios from 'axios'
export default {
name: "ApplicationList",
props: {
Expand All @@ -59,9 +60,29 @@ export default {
if (!this.isGroup) {
this.$store.state.friends.push(app)
}
this.updateRelation(app, 1)
},
refuseApplication(id) {
this.applications[id].status = 2
refuseApplication(app) {
app.status = 2
this.updateRelation(app, 2)
},
updateRelation(app, status) {
axios({
method: 'post',
url: '/chatting/relation/update',
data: {
requestId: app.id,
acceptId: app.acceptId,
type: app.type,
status: status,
},
responseType: 'json',
}).then(res => {
if (res.data.status == 200) {
} else {
console.log("network error")
}
})
},
}
}
Expand Down

0 comments on commit 655c846

Please sign in to comment.