1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-05-10 09:42:33 +00:00

revive articledetail

This commit is contained in:
Rokt33r
2015-10-13 16:09:37 +09:00
parent 5356e68b51
commit e5e8032ba1
16 changed files with 354 additions and 135 deletions

View File

@@ -1,6 +1,22 @@
var request = require('superagent-promise')(require('superagent'), Promise)
var apiUrl = require('../../../../config').apiUrl
export function fetchCurrentUser () {
return request
.get(apiUrl + 'auth/user')
.set({
Authorization: 'Bearer ' + localStorage.getItem('token')
})
}
export function fetchArticles (userId) {
return request
.get(apiUrl + 'teams/' + userId + '/articles')
.set({
Authorization: 'Bearer ' + localStorage.getItem('token')
})
}
export function createTeam (input) {
return request
.post(apiUrl + 'teams')

View File

@@ -0,0 +1,11 @@
import markdownit from 'markdown-it'
var md = markdownit({
typographer: true,
linkify: true
})
export default function markdown (content) {
if (content == null) content = ''
return md.render(content.toString())
}