Change direct message schema

This commit is contained in:
2025-05-08 19:09:17 +02:00
parent 67b0fd2c52
commit 789ab07afb
5 changed files with 282 additions and 189 deletions

View File

@@ -4,7 +4,8 @@
"info": {
"singularName": "conversation",
"pluralName": "conversations",
"displayName": "Conversation"
"displayName": "Conversation",
"description": ""
},
"options": {
"draftAndPublish": false
@@ -24,7 +25,8 @@
"direct_messages": {
"type": "relation",
"relation": "oneToMany",
"target": "api::direct-message.direct-message"
"target": "api::direct-message.direct-message",
"mappedBy": "conversation"
}
}
}

View File

@@ -4,7 +4,8 @@
"info": {
"singularName": "direct-message",
"pluralName": "direct-messages",
"displayName": "DirectMessage"
"displayName": "DirectMessage",
"description": ""
},
"options": {
"draftAndPublish": false
@@ -17,15 +18,16 @@
"fileUrl": {
"type": "string"
},
"user1": {
"author": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::users-permissions.user"
},
"user2": {
"conversation": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::users-permissions.user"
"relation": "manyToOne",
"target": "api::conversation.conversation",
"inversedBy": "direct_messages"
}
}
}

View File

@@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2025-05-06T21:44:09.671Z"
"x-generation-date": "2025-05-08T17:07:50.652Z"
},
"x-strapi-config": {
"plugins": [
@@ -33665,7 +33665,7 @@
"fileUrl": {
"type": "string"
},
"user1": {
"author": {
"type": "object",
"properties": {
"id": {
@@ -33676,7 +33676,7 @@
}
}
},
"user2": {
"conversation": {
"type": "object",
"properties": {
"id": {
@@ -33684,6 +33684,93 @@
},
"documentId": {
"type": "string"
},
"user1": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"user2": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"direct_messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"publishedAt": {
"type": "string",
"format": "date-time"
},
"createdBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"updatedBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"locale": {
"type": "string"
},
"localizations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
}
}
},
@@ -33788,93 +33875,6 @@
},
"documentId": {
"type": "string"
},
"user1": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"user2": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"direct_messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"publishedAt": {
"type": "string",
"format": "date-time"
},
"createdBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"updatedBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"locale": {
"type": "string"
},
"localizations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
}
}
}
@@ -33907,7 +33907,7 @@
"fileUrl": {
"type": "string"
},
"user1": {
"author": {
"oneOf": [
{
"type": "integer"
@@ -33918,7 +33918,7 @@
],
"example": "string or id"
},
"user2": {
"conversation": {
"oneOf": [
{
"type": "integer"
@@ -34000,7 +34000,7 @@
"fileUrl": {
"type": "string"
},
"user1": {
"author": {
"type": "object",
"properties": {
"id": {
@@ -36532,7 +36532,7 @@
}
}
},
"user2": {
"conversation": {
"type": "object",
"properties": {
"id": {
@@ -36540,6 +36540,172 @@
},
"documentId": {
"type": "string"
},
"user1": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"user2": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"direct_messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
},
"content": {
"type": "string"
},
"fileUrl": {
"type": "string"
},
"author": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"conversation": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"publishedAt": {
"type": "string",
"format": "date-time"
},
"createdBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"updatedBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"locale": {
"type": "string"
},
"localizations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
}
}
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"publishedAt": {
"type": "string",
"format": "date-time"
},
"createdBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"updatedBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"locale": {
"type": "string"
},
"localizations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
}
}
},
@@ -36590,85 +36756,6 @@
},
"documentId": {
"type": "string"
},
"content": {
"type": "string"
},
"fileUrl": {
"type": "string"
},
"user1": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"user2": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"publishedAt": {
"type": "string",
"format": "date-time"
},
"createdBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"updatedBy": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
},
"locale": {
"type": "string"
},
"localizations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"documentId": {
"type": "string"
}
}
}
}
}
}