change partner login response
This commit is contained in:
@@ -36,7 +36,10 @@ import {
|
|||||||
partnerUpdateRequestSchema,
|
partnerUpdateRequestSchema,
|
||||||
partnerVerifyRequestSchema,
|
partnerVerifyRequestSchema,
|
||||||
} from "@/modules/partner/partner.schemas";
|
} 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 * as dateFns from "date-fns";
|
||||||
import { Router, type Request, type Response } from "express";
|
import { Router, type Request, type Response } from "express";
|
||||||
import { ulid } from "ulid";
|
import { ulid } from "ulid";
|
||||||
@@ -154,13 +157,14 @@ export class PartnerController extends Controller {
|
|||||||
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
data: {
|
data: {
|
||||||
|
partner: this.mapper.mapEntityToResponse(partner),
|
||||||
access_token: access.token,
|
access_token: access.token,
|
||||||
access_token_expires_at: access.expiresAt,
|
access_token_expires_at: access.expiresAt,
|
||||||
refresh_token: refresh.token,
|
refresh_token: refresh.token,
|
||||||
refresh_token_expires_at: refresh.expiresAt,
|
refresh_token_expires_at: refresh.expiresAt,
|
||||||
},
|
},
|
||||||
errors: null,
|
errors: null,
|
||||||
} satisfies SingleResponse);
|
} satisfies SingleResponse<PartnerLoginResponse>);
|
||||||
}
|
}
|
||||||
|
|
||||||
async list(req: Request, res: Response) {
|
async list(req: Request, res: Response) {
|
||||||
|
|||||||
@@ -31,3 +31,11 @@ export type PartnerResponse = {
|
|||||||
created_at: Date;
|
created_at: Date;
|
||||||
updated_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;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user