In return for God's help in obtaining victory, they promised to build a church and keep the day as a holy Sabbath.
They promised to build a church and keep the day as a holy Sabbath. This was in return for God's help in. This was obtaining victory.