Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Add block and unblock
Browse files Browse the repository at this point in the history
  • Loading branch information
seia-soto committed Feb 20, 2021
1 parent 59b72e0 commit d54c6f3
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/api/block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import agent from '../structures/agent'

const block = async (profile, user) => {
'use strict'

const response = await agent(
'/block',
{
body: {
user_id: user || -1
}
},
profile
)
const data = await response.json()

return data
}

export default block

export const specification = {
success: Boolean
}
6 changes: 5 additions & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import getChannel from './getChannel'
import getNotifications from './getNotifications'
import getActionableNotifications from './getActionableNotifications'
import requestMobileAuthAgain from './requestMobileAuthAgain'
import block from './block'
import unblock from './unblock'

// NOTE: Externals
import getStatic from './getStatic'
Expand Down Expand Up @@ -111,5 +113,7 @@ export {
getChannel,
getNotifications,
getActionableNotifications,
requestMobileAuthAgain
requestMobileAuthAgain,
block,
unblock
}
24 changes: 24 additions & 0 deletions src/api/unblock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import agent from '../structures/agent'

const unblock = async (profile, user) => {
'use strict'

const response = await agent(
'/unblock',
{
body: {
user_id: user || -1
}
},
profile
)
const data = await response.json()

return data
}

export default unblock

export const specification = {
success: Boolean
}

0 comments on commit d54c6f3

Please sign in to comment.