Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SVR-123]재료 생성 버튼 연결 #85

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 89e904228d0524eebbff9d8903d0fb1a, type: 3}
m_Name:
m_EditorClassIdentifier:
svrReference: {fileID: 11400000, guid: 38e7c9c0fffe34996ae8cf5c6c4417ee, type: 2}
privateKeyHex: eda6ef63ae945cd15572fcf7d6635a8b3f8d86e85b57a353b482bc82c7fd2ad4
seedStateId: {fileID: 8778449230615227800}
seedId: {fileID: 8778449230942835930}
IngredientCreateButton: {fileID: 8778449231450303529}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public void CancelSubscribe()
public async void CreateNewSeed()
{
GraphApi.Query query = svrReference.GetQueryByName("CreateNewSeed", GraphApi.Query.Type.Mutation);
query.SetArgs(new { address });
query.SetArgs(new { privateKeyHex });
UnityWebRequest request = await svrReference.Post(query);
}
Expand Down
13 changes: 11 additions & 2 deletions frontend/Savor-22b/Assets/Scripts/Inventory/SeedUI.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using GraphQlClient.Core;
using GraphQlClient.EventCallbacks;
using UnityEngine.Networking;

public class SeedUI : MonoBehaviour
{
[Header("API")]
public GraphApi svrReference;
public string privateKeyHex;

public Text seedStateId;
public Text seedId;

Expand All @@ -17,9 +24,11 @@ public void SetSeedData(Seed seed)
SetIngredientCreateButton(seed.stateId);
}

public void CreateIngredient(Guid seedStateId)
public async void CreateIngredient(Guid seedStateId)
{
Debug.Log("Create ingredient");
GraphApi.Query query = svrReference.GetQueryByName(QueryNames.CREATE_INGREDIENT, GraphApi.Query.Type.Mutation);
query.SetArgs(new { privateKeyHex, seedStateId });
UnityWebRequest request = await svrReference.Post(query);
upa-r-upa marked this conversation as resolved.
Show resolved Hide resolved
}

public void SetIngredientCreateButton(Guid seedStateId)
Expand Down
1 change: 1 addition & 0 deletions frontend/Savor-22b/Assets/Scripts/Models/QueryNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
public static class QueryNames
{
public static readonly string GET_ALL_RECIPE = "GetAllRecipe";
public static readonly string CREATE_INGREDIENT = "CreateNewIngredient";
}
Loading