1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-28 03:10:45 +00:00
This commit is contained in:
孙永强 2025-03-28 14:47:13 +08:00 committed by r350178982
parent 42d2b28ad9
commit adc16c310a
2 changed files with 4 additions and 4 deletions

View File

@ -162,14 +162,14 @@ class Wiki extends Component {
if (page.id === pageId) {
return {
...page,
locked: !prevState.currentPageLocked
locked: res.data.is_locked
};
}
return page;
});
return {
currentPageLocked: !prevState.currentPageLocked,
currentPageLocked: res.data.is_locked,
config: new WikiConfig({
...prevState.config,
pages: updatedPages

View File

@ -884,7 +884,7 @@ class Wiki2PageView(APIView):
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
is_locked = seafile_api.check_file_lock(repo_id, path.lstrip('/'), '')
if is_locked == locked:
return Response('success', status=status.HTTP_200_OK)
return Response({'is_locked': locked}, status=status.HTTP_200_OK)
if locked:
try:
seafile_api.lock_file(repo_id, path.lstrip('/'), username, expire)
@ -899,7 +899,7 @@ class Wiki2PageView(APIView):
logger.error(e)
error_msg = 'Internal Server Error'
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
return Response('success', status=status.HTTP_200_OK)
return Response({'is_locked': locked}, status=status.HTTP_200_OK)
class Wiki2PublishPageView(APIView):