修改评论

This commit is contained in:
何童崇 2022-08-08 16:24:13 +08:00
parent 250c19d1f0
commit 1e3552bd0c
2 changed files with 9 additions and 2 deletions

View File

@ -49,7 +49,6 @@ export const Commenting = (props) => {
const submit = usePersistFn(async (note, type) => {
try {
console.log(note,type);
debugger;
await addComment({
note,
diffId: toVersion.id,

View File

@ -96,6 +96,7 @@ export const prService = {
item.author.username=item.user.name;
item.type='Common';
item.stDiff=item.diff;
// item.lineType='old';
}
return journals;
},
@ -161,7 +162,14 @@ export const prService = {
async addComment(projectsId, owner, mergeId, data) {
const res = await axios.post(`/v1/${owner}/${projectsId}/pulls/${mergeId}/journals.json`, data);
return res.data;
console.log('addComment===');
let commentData=underscoreToCamelcase(res.data);
commentData.author=commentData.user;
commentData.author.avatarUrl=commentData.user.imageUrl?getImageUrl(commentData.user.imageUrl):'';
commentData.author.username=commentData.user.name;
commentData.type='Common';
commentData.stDiff=commentData.diff;
return commentData;
},
async createReview(projectsId, owner, mergeId, data) {