Skip to content

Commit a6cd8e7

Browse files
committed
continue fix org
1 parent 07eb6c9 commit a6cd8e7

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

src/app/features/admin/user-management/pages/user-list/user-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export class UserListComponent {
329329

330330
Promise.resolve().then(() => {
331331
this.store.dispatch(
332-
setLoading({ isLoading: true, content: 'Đang thêm test case...' })
332+
setLoading({ isLoading: true, content: 'Đang xử lý, xin chờ...' })
333333
);
334334
});
335335

src/app/features/organization/pages/organization-management/organization-management.component.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
setLoading,
3333
} from '../../../../shared/store/loading-state/loading.action';
3434
import { decodeJWT } from '../../../../shared/utils/stringProcess';
35+
import { AuthService } from '../../../../core/services/api-service/auth.service';
3536

3637
@Component({
3738
selector: 'app-organization-management',
@@ -73,6 +74,7 @@ export class OrganizationManagementComponent implements OnInit, OnDestroy {
7374

7475
constructor(
7576
private orgService: OrganizationService,
77+
private authService: AuthService,
7678
private fb: FormBuilder,
7779
private router: Router,
7880
private store: Store
@@ -127,6 +129,17 @@ export class OrganizationManagementComponent implements OnInit, OnDestroy {
127129
});
128130
}
129131

132+
refreshTokenAfterCreatedOrg() {
133+
const token = localStorage.getItem('token') ?? '';
134+
135+
this.authService.refreshToken(token).subscribe({
136+
next: (res) => {
137+
localStorage.setItem('refreshToken', res.result.refreshToken);
138+
localStorage.setItem('token', res.result.accessToken);
139+
},
140+
});
141+
}
142+
130143
loadOrgs() {
131144
this.loading = true;
132145
const searchTerm = this.searchControl.value || '';
@@ -179,7 +192,7 @@ export class OrganizationManagementComponent implements OnInit, OnDestroy {
179192

180193
Promise.resolve().then(() => {
181194
this.store.dispatch(
182-
setLoading({ isLoading: true, content: 'Đang thêm test case...' })
195+
setLoading({ isLoading: true, content: 'Xin chờ, đang xử lý...' })
183196
);
184197
});
185198

@@ -219,6 +232,7 @@ export class OrganizationManagementComponent implements OnInit, OnDestroy {
219232
submitCreate(req: CreateOrgRequest) {
220233
this.orgService.createOrg(req).subscribe({
221234
next: () => {
235+
this.refreshTokenAfterCreatedOrg();
222236
setTimeout(() => {
223237
this.loadOrgs();
224238
}, 2000);

src/app/features/post/pages/post-create/post-create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ export class PostCreatePageComponent {
313313
// Debug nhanh
314314
const payload: CreatePostRequest = {
315315
title: this.post.title,
316+
orgId: this.post.postType === 'Org' ? this.myOrgId : undefined,
316317
content: this.htmlToMd.convert(this.editorContent || ''),
317318
isPublic: this.post.postType !== 'Private',
318319
allowComment: this.post.allowComment ?? false,

src/app/shared/components/fxdonad-shared/comment/comment.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>Đã tải {{ totalCommentsCount }} Bình luận</h3>
4040
@if (authenticated) {
4141
<div class="reply-section" [class.opened]="showReplies[comment.id]">
4242
<div class="line-connect"></div>
43-
<img [src]="userAvatar" class="avatar small" />
43+
<img [src]="userAvatar || avatarDefault" class="avatar small" />
4444
<input [(ngModel)]="replyMap[comment.id]" placeholder="Phản hồi..." />
4545
<button (click)="submitReplyComment(comment.id)">Gửi</button>
4646
</div>
@@ -54,7 +54,7 @@ <h3>Đã tải {{ totalCommentsCount }} Bình luận</h3>
5454
}
5555
<div class="line-border-connect-replies"></div>
5656
<div class="comment-header-replies">
57-
<img [src]="reply.user.avatarUrl" class="avatar" />
57+
<img [src]="reply.user.avatarUrl || avatarDefault" class="avatar" />
5858
<div class="replies-info">
5959
<div class="user-replies">
6060
<strong>{{ reply.user.username }}</strong>

0 commit comments

Comments
 (0)