change partner login response

This commit is contained in:
ItsMalma
2025-12-01 21:38:43 +07:00
parent 5efb5f3594
commit 8e8c87e334
2 changed files with 14 additions and 2 deletions

View File

@@ -36,7 +36,10 @@ import {
partnerUpdateRequestSchema,
partnerVerifyRequestSchema,
} from "@/modules/partner/partner.schemas";
import type { PartnerResponse } from "@/modules/partner/partner.types";
import type {
PartnerLoginResponse,
PartnerResponse,
} from "@/modules/partner/partner.types";
import * as dateFns from "date-fns";
import { Router, type Request, type Response } from "express";
import { ulid } from "ulid";
@@ -154,13 +157,14 @@ export class PartnerController extends Controller {
return res.status(200).json({
data: {
partner: this.mapper.mapEntityToResponse(partner),
access_token: access.token,
access_token_expires_at: access.expiresAt,
refresh_token: refresh.token,
refresh_token_expires_at: refresh.expiresAt,
},
errors: null,
} satisfies SingleResponse);
} satisfies SingleResponse<PartnerLoginResponse>);
}
async list(req: Request, res: Response) {

View File

@@ -31,3 +31,11 @@ export type PartnerResponse = {
created_at: Date;
updated_at: Date;
};
export type PartnerLoginResponse = {
partner: PartnerResponse;
access_token: string;
access_token_expires_at: Date;
refresh_token: string;
refresh_token_expires_at: Date;
};