use api v2 for add comment
This commit is contained in:
@@ -16,6 +16,7 @@ import renderMd from './Markdown';
|
|||||||
export { format_time, Time, TitleLine };
|
export { format_time, Time, TitleLine };
|
||||||
|
|
||||||
export const API_BASE = `${process.env.REACT_APP_BACKEND || '/'}_api/v1`;
|
export const API_BASE = `${process.env.REACT_APP_BACKEND || '/'}_api/v1`;
|
||||||
|
export const API_BASE_2 = `${process.env.REACT_APP_BACKEND || '/'}_api/v2`;
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
// https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
||||||
function escape_regex(string) {
|
function escape_regex(string) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {
|
import {
|
||||||
API_BASE,
|
API_BASE,
|
||||||
|
API_BASE_2,
|
||||||
SafeTextarea,
|
SafeTextarea,
|
||||||
PromotionBar,
|
PromotionBar,
|
||||||
HighlightedMarkdown,
|
HighlightedMarkdown,
|
||||||
@@ -395,11 +396,10 @@ export class ReplyForm extends Component {
|
|||||||
const { pid } = this.props;
|
const { pid } = this.props;
|
||||||
const { text, use_title } = this.state;
|
const { text, use_title } = this.state;
|
||||||
let data = new URLSearchParams({
|
let data = new URLSearchParams({
|
||||||
pid: pid,
|
|
||||||
text: text,
|
text: text,
|
||||||
use_title: use_title ? '1' : '',
|
use_title: use_title ? '1' : '',
|
||||||
});
|
});
|
||||||
fetch(API_BASE + '/docomment', {
|
fetch(`${API_BASE_2}/post/${pid}/comment`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
|||||||
Reference in New Issue
Block a user