fix non-optional values
This commit is contained in:
parent
5899efd759
commit
80425813c3
@ -23,13 +23,13 @@ func (svc *Service) CreateSubmission(ctx context.Context, request api.OptSubmiss
|
|||||||
|
|
||||||
submission, err := svc.DB.Submissions().Create(ctx, model.Submission{
|
submission, err := svc.DB.Submissions().Create(ctx, model.Submission{
|
||||||
ID: 0,
|
ID: 0,
|
||||||
DisplayName: request.Value.DisplayName.Value,
|
DisplayName: request.Value.DisplayName,
|
||||||
Creator: request.Value.Creator.Value,
|
Creator: request.Value.Creator,
|
||||||
GameID: request.Value.GameID.Value,
|
GameID: request.Value.GameID,
|
||||||
Date: time.Now(),
|
Date: time.Now(),
|
||||||
Submitter: int64(userInfo.UserID),
|
Submitter: int64(userInfo.UserID),
|
||||||
AssetID: request.Value.AssetID.Value,
|
AssetID: request.Value.AssetID,
|
||||||
AssetVersion: request.Value.AssetVersion.Value,
|
AssetVersion: request.Value.AssetVersion,
|
||||||
Completed: false,
|
Completed: false,
|
||||||
TargetAssetID: request.Value.TargetAssetID.Value,
|
TargetAssetID: request.Value.TargetAssetID.Value,
|
||||||
StatusID: model.StatusUnderConstruction,
|
StatusID: model.StatusUnderConstruction,
|
||||||
@ -38,7 +38,7 @@ func (svc *Service) CreateSubmission(ctx context.Context, request api.OptSubmiss
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &api.ID{
|
return &api.ID{
|
||||||
ID:api.NewOptInt64(submission.ID),
|
ID:submission.ID,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,17 +53,17 @@ func (svc *Service) GetSubmission(ctx context.Context, params api.GetSubmissionP
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &api.Submission{
|
return &api.Submission{
|
||||||
ID: api.NewOptInt64(submission.ID),
|
ID: submission.ID,
|
||||||
DisplayName: api.NewOptString(submission.DisplayName),
|
DisplayName: submission.DisplayName,
|
||||||
Creator: api.NewOptString(submission.Creator),
|
Creator: submission.Creator,
|
||||||
GameID: api.NewOptInt32(submission.GameID),
|
GameID: submission.GameID,
|
||||||
Date: api.NewOptInt64(submission.Date.Unix()),
|
Date: submission.Date.Unix(),
|
||||||
Submitter: api.NewOptInt64(submission.Submitter),
|
Submitter: submission.Submitter,
|
||||||
AssetID: api.NewOptInt64(submission.AssetID),
|
AssetID: submission.AssetID,
|
||||||
AssetVersion: api.NewOptInt64(submission.AssetVersion),
|
AssetVersion: submission.AssetVersion,
|
||||||
Completed: api.NewOptBool(submission.Completed),
|
Completed: submission.Completed,
|
||||||
TargetAssetID: api.NewOptInt64(submission.TargetAssetID),
|
TargetAssetID: api.NewOptInt64(submission.TargetAssetID),
|
||||||
StatusID: api.NewOptInt32(int32(submission.StatusID)),
|
StatusID: int32(submission.StatusID),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,17 +92,17 @@ func (svc *Service) ListSubmissions(ctx context.Context, request api.ListSubmiss
|
|||||||
var resp []api.Submission
|
var resp []api.Submission
|
||||||
for i := 0; i < len(items); i++ {
|
for i := 0; i < len(items); i++ {
|
||||||
resp = append(resp, api.Submission{
|
resp = append(resp, api.Submission{
|
||||||
ID: api.NewOptInt64(items[i].ID),
|
ID: items[i].ID,
|
||||||
DisplayName: api.NewOptString(items[i].DisplayName),
|
DisplayName: items[i].DisplayName,
|
||||||
Creator: api.NewOptString(items[i].Creator),
|
Creator: items[i].Creator,
|
||||||
GameID: api.NewOptInt32(items[i].GameID),
|
GameID: items[i].GameID,
|
||||||
Date: api.NewOptInt64(items[i].Date.Unix()),
|
Date: items[i].Date.Unix(),
|
||||||
Submitter: api.NewOptInt64(items[i].Submitter),
|
Submitter: items[i].Submitter,
|
||||||
AssetID: api.NewOptInt64(items[i].AssetID),
|
AssetID: items[i].AssetID,
|
||||||
AssetVersion: api.NewOptInt64(items[i].AssetVersion),
|
AssetVersion: items[i].AssetVersion,
|
||||||
Completed: api.NewOptBool(items[i].Completed),
|
Completed: items[i].Completed,
|
||||||
TargetAssetID: api.NewOptInt64(items[i].TargetAssetID),
|
TargetAssetID: api.NewOptInt64(items[i].TargetAssetID),
|
||||||
StatusID: api.NewOptInt32(int32(items[i].StatusID)),
|
StatusID: int32(items[i].StatusID),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user