mehdikhody / 3x-ui-js

This is an interface for 3x-ui panel. It will help developers to create, edit and delete inbounds and clients in a simple way.
5 stars 2 forks source link

update client bug #1

Open sutogan4ik opened 1 week ago

sutogan4ik commented 1 week ago

you expect client id, but in fact client id is uuid, and when requesting default options you use it as email

async updateClient(inboundId, clientId, options) {
        await this.getInbound(inboundId);
        const defaultOptions = await this.getClientOptions(clientId);
        if (!defaultOptions) {
            throw new Error("Client not found to be updated.");
        }
        await this.post(`/updateClient/${defaultOptions.id}`, { //<--- please fix this, its uuid
            id: inboundId,
            settings: JSON.stringify({
                clients: [
                    {
                        ...defaultOptions,
                        ...options,
                    },
                ],
            }),
        });
        this.flushCache();
        this.logger.debug(`Client ${clientId} updated.`);
    }
vavko commented 1 week ago

we have same problem. Can you fix this?