Skip to content

Commit

Permalink
Merge branch 'master' into 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imwhatiam committed Jun 11, 2024
2 parents 7e43797 + 7bcb54e commit 02a7998
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions frontend/src/pages/org-admin/org-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OrgLinks extends React.Component {
}

listOrgLinks = (page) => {
seafileAPI.orgAdminListOrgLinks(this.state.page).then(res => {
seafileAPI.orgAdminListOrgLinks(page).then(res => {
const data = res.data;
this.setState({
linkList: data.link_list,
Expand All @@ -45,7 +45,7 @@ class OrgLinks extends React.Component {
onChangePageNum = (event, num) => {
event.preventDefault();
let page = this.state.page;
if (num == 1) {
if (num === 1) {
page = page + 1;
} else {
page = page - 1;
Expand Down Expand Up @@ -122,8 +122,8 @@ class OrgLinks extends React.Component {
</tbody>
</table>
<div className="paginator">
{this.state.page != 1 && <a href="#" onClick={(e) => this.onChangePageNum(e, -1)}>{gettext('Previous')}</a>}
{(this.state.page != 1 && this.state.pageNext) && <span> | </span>}
{this.state.page !== 1 && <a href="#" onClick={(e) => this.onChangePageNum(e, -1)}>{gettext('Previous')}</a>}
{(this.state.page !== 1 && this.state.pageNext) && <span> | </span>}
{this.state.pageNext && <a href="#" onClick={(e) => this.onChangePageNum(e, 1)}>{gettext('Next')}</a>}
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions seahub/organizations/api/admin/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def get(self, request):
offset = per_page * (current_page - 1)
limit = per_page + 1
org_id = request.user.org.org_id

ofs = OrgFileShare.objects.filter(org_id=org_id)[offset:offset + limit]
ofs = OrgFileShare.objects.filter(org_id=org_id).order_by('-file_share__ctime')[offset:offset + limit]
publinks = [ x.file_share for x in ofs ]

if len(publinks) == per_page + 1:
Expand Down

0 comments on commit 02a7998

Please sign in to comment.