fix: fix some changes

This commit is contained in:
2026-07-13 17:04:00 +03:30
parent 4e4731dbde
commit 4e400d79e8
8 changed files with 39 additions and 22 deletions
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AnswerSubmissionV21783945681366 implements MigrationInterface {
name = 'AnswerSubmissionV21783945681366'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "test" ADD "questionsCount" integer NOT NULL DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE "submission" ADD "currentQuestionOrder" integer NOT NULL DEFAULT '1'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "submission" DROP COLUMN "currentQuestionOrder"`);
await queryRunner.query(`ALTER TABLE "test" DROP COLUMN "questionsCount"`);
}
}
@@ -3,9 +3,9 @@ Authorization: Bearer {{$global.accessToken}}
Content-Type: application/json
{
"question": 4,
"text": "Option 2",
"value": 1,
"order": 2,
"score": 2
"question": 2,
"text": "Option 3",
"value": 3,
"order": 3,
"score": 6
}
@@ -3,12 +3,11 @@ Authorization: Bearer {{$global.accessToken}}
Content-Type: application/json
{
"test": 4,
"content": "سوال پنجم",
"order": 4,
"test": 1,
"content": "سوال سوم",
"required": true,
"type": "numeric",
"metadata": { "min": 1, "max": 100 }
"metadata": { "min": 1, "max": 20 }
}
POST {{baseUrl}}/admin/questions/range-rules
@@ -16,8 +15,8 @@ Authorization: Bearer {{$global.accessToken}}
Content-Type: application/json
{
"question": 8,
"question": 3,
"min": 1,
"max": 5,
"score": 7
"max": 10,
"score": 10
}
@@ -3,9 +3,8 @@ Content-Type: application/json
Authorization: Bearer {{$global.accessToken}}
{
"title": "Test Five",
"description": "Description Five",
"title": "Test One",
"description": "Description One",
"accessType": "login",
"price": "1234000",
"isActive": true
}
@@ -2,8 +2,8 @@ POST {{baseUrl}}/auth/verify-otp
Content-Type: application/json
{
"phone": "09365858721",
"otp": "40023"
"phone": "09333026363",
"otp": "87074"
}
{{
+2 -1
View File
@@ -52,8 +52,9 @@ export class LoginProvider {
return {
newUser: true,
message,
otpExpiresAt: otpCode.expiresAt,
// Just for development
code: otpCode,
code: otpCode.code,
};
}
+4 -2
View File
@@ -32,7 +32,9 @@ export class OtpService {
/**
* Create new OTP record
*/
public async createOTP(phone: string): Promise<string> {
public async createOTP(
phone: string,
): Promise<{ code: string; expiresAt: Date }> {
// OTP request Rate limit
const lastOTP = await this.otpRepository.findOne({
where: { phone },
@@ -54,7 +56,7 @@ export class OtpService {
await this.otpRepository.save(otp);
return code;
return { code, expiresAt: otp.expiresAt };
}
/**
@@ -4,8 +4,8 @@ Authorization: Bearer {{$global.accessToken}}
lang: fa
{
"firstName": "تست",
"lastName": "تستعلی",
"firstName": "رادمهر",
"lastName": "ترناس",
"password": "Password1@",
"confirmPassword": "Password1@"
}