Skip to content

Commit

Permalink
fix: update the profile picture in the navigation-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal committed Sep 16, 2024
1 parent 4735db8 commit ab4a37c
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 11 deletions.
10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/create_profile_image_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/partner_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/user_admin_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/user_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8746,6 +8746,10 @@
},
"CreateProfileImageResponseDto": {
"properties": {
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
},
Expand All @@ -8754,6 +8758,7 @@
}
},
"required": [
"profileChangedAt",
"profileImagePath",
"userId"
],
Expand Down Expand Up @@ -9963,6 +9968,10 @@
"name": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
}
Expand All @@ -9972,6 +9981,7 @@
"email",
"id",
"name",
"profileChangedAt",
"profileImagePath"
],
"type": "object"
Expand Down Expand Up @@ -12402,6 +12412,10 @@
"oauthId": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
},
Expand Down Expand Up @@ -12440,6 +12454,7 @@
"license",
"name",
"oauthId",
"profileChangedAt",
"profileImagePath",
"quotaSizeInBytes",
"quotaUsageInBytes",
Expand Down Expand Up @@ -12601,6 +12616,10 @@
"name": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
}
Expand All @@ -12610,6 +12629,7 @@
"email",
"id",
"name",
"profileChangedAt",
"profileImagePath"
],
"type": "object"
Expand Down
4 changes: 4 additions & 0 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type UserResponseDto = {
email: string;
id: string;
name: string;
profileChangedAt: string;
profileImagePath: string;
};
export type ActivityResponseDto = {
Expand Down Expand Up @@ -53,6 +54,7 @@ export type UserAdminResponseDto = {
license: (UserLicense) | null;
name: string;
oauthId: string;
profileChangedAt: string;
profileImagePath: string;
quotaSizeInBytes: number | null;
quotaUsageInBytes: number | null;
Expand Down Expand Up @@ -666,6 +668,7 @@ export type PartnerResponseDto = {
id: string;
inTimeline?: boolean;
name: string;
profileChangedAt: string;
profileImagePath: string;
};
export type UpdatePartnerDto = {
Expand Down Expand Up @@ -1249,6 +1252,7 @@ export type CreateProfileImageDto = {
file: Blob;
};
export type CreateProfileImageResponseDto = {
profileChangedAt: string;
profileImagePath: string;
userId: string;
};
Expand Down
8 changes: 7 additions & 1 deletion server/src/dtos/user-profile.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ export class CreateProfileImageDto {

export class CreateProfileImageResponseDto {
userId!: string;
profileChangedAt!: Date;
profileImagePath!: string;
}

export function mapCreateProfileImageResponse(userId: string, profileImagePath: string): CreateProfileImageResponseDto {
export function mapCreateProfileImageResponse(
userId: string,
profileImagePath: string,
profileChangedAt: Date,
): CreateProfileImageResponseDto {
return {
userId,
profileChangedAt,
profileImagePath,
};
}
2 changes: 2 additions & 0 deletions server/src/dtos/user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class UserResponseDto {
profileImagePath!: string;
@ApiProperty({ enumName: 'UserAvatarColor', enum: UserAvatarColor })
avatarColor!: UserAvatarColor;
profileChangedAt!: Date;
}

export class UserLicense {
Expand All @@ -47,6 +48,7 @@ export const mapUser = (entity: UserEntity): UserResponseDto => {
name: entity.name,
profileImagePath: entity.profileImagePath,
avatarColor: getPreferences(entity).avatar.color,
profileChangedAt: entity.profileChangedAt,
};
};

Expand Down
3 changes: 3 additions & 0 deletions server/src/entities/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ export class UserEntity {

@OneToMany(() => UserMetadataEntity, (metadata) => metadata.user)
metadata!: UserMetadataEntity[];

@UpdateDateColumn({ type: 'timestamptz' })
profileChangedAt!: Date;
}
Loading

0 comments on commit ab4a37c

Please sign in to comment.