0.12.2 : fix update user

This commit is contained in:
2025-11-12 21:12:29 +01:00
parent b8a2bc0aef
commit 1e642d194e
5 changed files with 66 additions and 329 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "harmony-back",
"version": "0.12.1",
"version": "0.12.2",
"private": true,
"description": "A Strapi application",
"scripts": {

View File

@@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2025-11-12T14:43:35.118Z"
"x-generation-date": "2025-11-12T20:11:53.117Z"
},
"x-strapi-config": {
"plugins": [
@@ -17853,30 +17853,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -18345,20 +18335,6 @@
}
}
},
"UserLanguageComponent": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"language": {
"type": "string"
},
"level": {
"type": "integer"
}
}
},
"AnnouncementRequest": {
"type": "object",
"required": [
@@ -21483,30 +21459,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -25426,30 +25392,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -28928,30 +28884,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -32878,30 +32824,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -37079,30 +37015,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -41729,30 +41655,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -45669,30 +45585,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -49511,30 +49417,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -53340,30 +53236,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -57205,30 +57091,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -60962,30 +60838,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -64896,30 +64762,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -68903,30 +68759,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -72399,30 +72245,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -76824,30 +76660,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -80638,30 +80464,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -84773,30 +84589,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -88620,30 +88426,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -92571,30 +92367,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -96423,30 +96209,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -99780,30 +99556,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -104346,30 +104112,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -108241,30 +107997,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"
@@ -112096,30 +111842,20 @@
}
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SocialTagsComponent"
}
},
"activities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupActivityComponent"
}
},
"languages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserLanguageComponent"
}
},
"bio": {
"type": "string"
},
"experience": {
"type": "integer"
},
"tags": {},
"languages": {},
"createdAt": {
"type": "string",
"format": "date-time"

View File

@@ -209,26 +209,22 @@
"target": "api::post-ownership.post-ownership",
"mappedBy": "author"
},
"tags": {
"type": "component",
"repeatable": true,
"component": "social.tags"
},
"activities": {
"type": "component",
"repeatable": true,
"component": "group.activity"
},
"languages": {
"type": "component",
"repeatable": true,
"component": "user.language"
},
"bio": {
"type": "text"
},
"experience": {
"type": "integer"
},
"tags": {
"type": "json"
},
"languages": {
"type": "json"
}
}
}

View File

@@ -204,20 +204,25 @@ module.exports = (plugin) => {
"phone",
"bio",
"experience",
"tags",
"languages",
]);
/*
if (data.tags) {
newData.tags = data.tags.map((tag) => ({
__component: "social.tags",
text: tag.text,
}));
}
if (data.languages) {
newData.languages = data.languages.map((lang) => ({
__component: "user.language",
language: lang.language,
level: lang.level,
}));
}
}*/
if (newData.username) {
const userWithSameUsername = await strapi

View File

@@ -1881,7 +1881,7 @@ export interface PluginUsersPermissionsUser
job: Schema.Attribute.Enumeration<
['choir_director', 'choir_addict', 'choir_master', 'choir_singer', 'none']
>;
languages: Schema.Attribute.Component<'user.language', true>;
languages: Schema.Attribute.JSON;
locale: Schema.Attribute.String & Schema.Attribute.Private;
localizations: Schema.Attribute.Relation<
'oneToMany',
@@ -1912,7 +1912,7 @@ export interface PluginUsersPermissionsUser
>;
saved_posts: Schema.Attribute.Relation<'oneToMany', 'api::post.post'>;
surname: Schema.Attribute.String;
tags: Schema.Attribute.Component<'social.tags', true>;
tags: Schema.Attribute.JSON;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;