fix(organization): pass avatar when creating shared space

The create flow was missing the avatar field in both the store's create() function signature and the modal's create call, while the update flow correctly passed it. Added avatar parameter to orgStore.create() and included formData.avatar in the create invocation.
main
Binks Riverton 2026-07-29 21:44:54 +08:00 committed by lyingbug
parent db9bdc27cd
commit 3f94895d60
2 changed files with 4 additions and 3 deletions

View File

@ -191,11 +191,11 @@ export const useOrganizationStore = defineStore('organization', () => {
/**
* Create a new organization
*/
async function create(name: string, description?: string) {
async function create(name: string, description?: string, avatar?: string) {
loading.value = true
error.value = null
try {
const response = await createOrganization({ name, description })
const response = await createOrganization({ name, description, avatar })
if (response.success && response.data) {
upsertOrganization(response.data)
// 创建成功后重置缓存时间戳,确保后续 fetchOrganizations() 不会被 TTL 缓存跳过,

View File

@ -1502,7 +1502,8 @@ const handleSave = async () => {
// 创建模式
const result = await orgStore.create(
formData.value.name.trim(),
formData.value.description.trim()
formData.value.description.trim(),
formData.value.avatar || undefined
)
if (result) {
MessagePlugin.success(t('organization.createSuccess'))